Bug 1005912 - Cannot build any C code
Cannot build any C code
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: eclipse-cdt (Show other bugs)
19
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Jeff Johnston
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-09 12:22 EDT by Jan Kratochvil
Modified: 2014-07-14 13:47 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-07-11 17:59:53 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Kratochvil 2013-09-09 12:22:54 EDT
Description of problem:
Basic hello world does not build.

Version-Release number of selected component (if applicable):
eclipse-cdt-8.2.0-2.fc19.x86_64

How reproducible:
Always.

Steps to Reproduce:
rm -rf .eclipse/
eclipse
Create sample Linux GCC Hello world code.
Build project.

Actual results:
Errors occurred during the build.
Errors running builder 'CDT Builder' on project 'hello2'.
Internal error building project hello2 configuration Debug
java.lang.NullPointerException
Internal error building project hello2 configuration Debug
java.lang.NullPointerException

+warning:
Invalid project path: Include path not found (/usr/lib/gcc/x86_64-redhat-linux/4.7.2/include).
On element: hello2
Location: pathentry

Expected results:
Build sample app.

Additional info:
4.7.2 looks as a leftover from previous distro but I have deleted ~/.eclipse.
This system was yum-upgraded F18->F19.
Sorry I have not tried it on a fresh install of F-19.
Still yum-upgraded F-19 should work.
Comment 1 Jeff Johnston 2013-09-10 18:15:09 EDT
Fresh F19 works fine for me in VM.  I have updated everything.

Are you reusing a workspace you had from F18?

A lot of data is saved in the .metadata for the workspace.  There is information in the .cproject file found within the project and in the pdom.  In theory, this should be ok if you have created a brand new project, but it is possible that CDT is caching the builtin include path and builtin macros from gcc.  Old projects that are still around may show errors as they might attempt a rebuild with automatic build set on.

Can you confirm that you are creating a new project from scratch and that it is called hello2 (the one showing errors).

Are you creating an Executable project or an Autotools project?  If you could include the full console log (you can find the location in the Project->Properties->C/C++ Build->Logging), that would be helpful.

If you are reusing an existing workspace, a workaround for this would be to use a new workspace, but you are correct that there should be some way to reuse/rebuild projects in an existing workspace when this occurs or to recognize that the data is no longer valid and prompt the user.
Comment 2 Jan Kratochvil 2013-09-10 21:00:22 EDT
(In reply to Jeff Johnston from comment #1)
> Are you reusing a workspace you had from F18?
Yes.  With new ~/workspace (I did not notice ~/workspace/.metadata) I no longer get the /usr/lib/gcc/x86_64-redhat-linux/4.7.2/include error.

But I still get the same java.lang.NullPointerException.

> Can you confirm that you are creating a new project from scratch and that it
> is called hello2 (the one showing errors).

Yes.

> Are you creating an Executable project or an Autotools project?

Executable->Hello World ANSI C Project->Linux GCC

> If you could include the full console log

01:56:52 **** Clean-only build of configuration Debug for project hello2 ****
make clean
rm -rf  ./src/hello2.o  ./src/hello2.d  hello2
01:56:52 Build Finished (took 60ms)

> If you are reusing an existing workspace,

No longer.

> Fresh F19 works fine for me in VM.  I have updated everything.

'yum distro-sync' is OK, rpm -V $(rpm -qa '*eclipse*') is OK, ~/.eclipse and ~/workspace are deleted so I am not aware what could be broken there.

But I understand the upgrade path is not such a concern if a new F-19 installation works OK.
Comment 3 Roland Grunberg 2013-09-11 09:39:12 EDT
This seems like Bug 870022 . You could maybe try performing the proposed workaround in the first comment but it seems like a fresh workspace was also what worked in the end.
Comment 4 Jan Kratochvil 2013-09-11 13:26:47 EDT
(In reply to Roland Grunberg from comment #3)
> This seems like Bug 870022

The GCC version problem is really gone after I recreated the workspace.

Unfortunately the java.lang.NullPointerException problem remains (I do not know how to get a real Java backtrace for that error).

Feel free to WONTFIX it, though. It seems to be just due to the F18->F19 upgrade I think.
Comment 5 Jeff Johnston 2014-07-11 17:59:53 EDT
I cannot get the NPE to reproduce.  All the sample Hello templates work fine as they are very basic scenarios.  The level of eclipse-cdt has been bumped since the original post to Kepler SR1 for F19 and F19 will soon be approaching EOL.  Please try on F20 if you have updated which has Kepler SR2 CDT.  If the problem has persists, please reopen or if you have a different failure, please open a new bug.
Comment 6 Jan Kratochvil 2014-07-12 02:39:07 EDT
It works now with:
  eclipse-cdt-8.2.1-3.fc20.x86_64
Comment 7 Jeff Johnston 2014-07-14 13:47:00 EDT
(In reply to Jan Kratochvil from comment #6)
> It works now with:
>   eclipse-cdt-8.2.1-3.fc20.x86_64

Thanks for the update.

Note You need to log in before you can comment on or make changes to this bug.