Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362010 - The current working directory is changed to “/default/<proj>/<config> when using C/C++ compiler and try to build the project
Summary: The current working directory is changed to “/default/<proj>/<config> when us...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-25 17:39 EDT by Onkelinx CLA
Modified: 2020-09-04 15:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Onkelinx CLA 2011-10-25 17:39:52 EDT
Build Identifier: 20110916-0149

Here we explain how you can simulate the issue:

We have used eclipse Indigo 3.7 with the RTC 3.0.1 plug-in. (see www.jazz.net) Rational Team Concert

For what concerns the RTC compatibility issue: The essential problem that I found is that when building using the Internal Builder, the current working directory is changed to “/default/<proj>/<config>”. So, any tool which is invoked will operate in an invalid folder.

This is because RTC installs its own Eclipse file system extension (EFS), which uses URIs with a custom protocol to access files (e.g. “sourcecontrol://jazz/default/HelloWorldGcc2/src/HelloWorldGcc2.c”). 

As far as I could see, the RTC file system extension is not compatible with the CDT Internal builder.
An easily reproducible test case is to build a project using GCC:

* Using Eclipse Version: Indigo Service Release 1 Build id: 20110916-0149, with CDT 8.0.1 installed.
* Install MinGW gcc tools for Windows as described in CDT help: http://help.eclipse.org/indigo/index.jsp
* Create a new C project using the MinGW GCC toolchain and the ‘Hello World ANSI C Project’ template (from C/C++ perspective, use File > New > C Project > Executable > ‘Hello World ANSI C Project’ and MinGW GCC)
* Verify that the project builds correctly
* Share the project using RTC (Right click on project > Team > Share project… > Jazz Source Control)
* Clean the project and verify that the ‘rm’ tool results in an error similar to:

rm -rf C:/default/HelloWorldGcc2/Debug/src/HelloWorldGcc2.d C:/eclipseTests/eclipse-cpp-indigo-SR1-incubation-win32-RTC/eclipse/workspace/HelloWorldGcc2/Debug/HelloWorldGcc2.exe C:/eclipseTests/eclipse-cpp-indigo-SR1-incubation-win32-RTC/eclipse/workspace/HelloWorldGcc2/Debug/src/HelloWorldGcc2.o
Error: Cannot run program "rm": The directory name is invalid.

* Build the project and verify that the following error is displayed in the build console:

**** Rebuild of configuration Debug for project HelloWorldGcc2 ****

**** Internal Builder is used for build ****
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o C:\default\HelloWorldGcc2\Debug\src\HelloWorldGcc2.o C:\eclipseTests\eclipse-cpp-indigo-SR1-incubation-win32-RTC\eclipse\workspace\HelloWorldGcc2\src\HelloWorldGcc2.c
Error: Cannot run program "gcc": The directory name is invalid.

Build error occurred, build is stopped
Time consumed: 41 ms. 

* Disconnect the project from source control (Right click on project > Team > Disconnect)
* Build the project and you can seen that the build now works

IBM has answer on this problems as follow:
- Look like a bug in CDT, it would be caused by using IFileStore.toURL().getPath() instead of IFileStore.toLocalFile(), or IResource.getLocationURI().getPath() instead of EFS.getStore(IResource.getLocationURI()).toLocalFile(), etc..
- RTC uses a feature of Eclipse (EFS) that exposes a bug in CDT.
- see also defect workitem: https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=181442


Reproducible: Always

Steps to Reproduce:
1.
See Details
Comment 1 Onkelinx CLA 2011-10-25 17:45:44 EDT
This problem we don't have in eclipse 3.5 and 3.6