Bug 351836 - Bug when import paths and settings
Summary: Bug when import paths and settings
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 minor with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 275779
  Show dependency tree
 
Reported: 2011-07-12 09:31 EDT by lerhes CLA
Modified: 2020-09-04 15:27 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lerhes CLA 2011-07-12 09:31:32 EDT
This happened in windows XP on CDT Indigo.

Details about Eclipse CDT version:
Eclipse C/C++ Development Tools

Version: 8.0.0.201106081058
Build id: 201106081058

(c) Copyright Eclipse contributors and others, 2000, 2010.  All rights reserved.
Visit http://www.eclipse.org/cdt


Problem:
When you export "Paths and Symbols" from C/C++ General they are save into XML. That's ok -> i checked XML file, and structure looks fine. But in addition, I have Environment variable in path name, like this:
${SOURCE_PATH}/General/include/

As I mentioned: SOURCE_PATH is declared in C/C++ Build in Environment, and look like: name: SOURCE_PATH variable: C:\CodeBase\Source.

So after export "Paths and Symbols" from one WorkSpace I get xml file with paths like this:
${SOURCE_PATH}/General/include/

When i try to import such a xml to another WorkSpace ... nothing happened. I checked XML file to load (in "Import C/C++ settings" window ), then click ok... and window disappeared but paths didn't load. I try it like hundred times, but no idea what was wrong. After that ... when i was tired and angry i just add this path one by one.

But then i need add this path again.. so i made more research and i discover what was wrong: paths from XML won't load if you use environment variable (like: ${SOURCE_PATH}) and you don't define it in C/C++ Build -> Environment (in new WorkSpace)! That take half of my day... it would be VERY helpful if Eclipse could inform user why load path failed, with some kind of message, like:
"Failed to load paths, symbol ${SOURCE_PATH} not defined!"
or
"Failed to load paths, some kind of environment variable missing"

Sorry for poor English skills.
Lerhes
-- Configuration Details --
Product: Eclipse 1.4.0.20110609-1120 (org.eclipse.epp.package.cpp.product)
Installed Features:
 org.eclipse.platform 3.7.0.v20110530-9gF7UHNFFt4cwE-pkZDJ7oz-mj4OSEIlu9SEv0f
Comment 1 Tomasz Zarna CLA 2011-07-13 09:09:22 EDT
This sounds more like a CDT issue (picked a random component, please reassign if needed).
Comment 2 Leo L CLA 2013-07-17 15:45:02 EDT
This is a serious bug. It prevents users from discovering header include paths using an external tool and then importing them into the project, or from importing paths used with one language into another related language. 

It appears that the reason import fails is related to the language name. In some saved .xml files it is "C Source File". But the listing on the Include Paths dialog box is "SAS C". Editing the XML file manually and replacing "C Source File" with "SAS C" seems to allow the import to proceed.

This is the relevant tag in the XML file:

<language name="C Source File">

should be

<language name="GNU C">

A message indicating that there was no match for the languages defined would be adequate: "No import settings found for any of the languages defined in this project". The proper fix (seems to work in Kepler) is to make sure that the language name written is the same language name read. A Superb fix would be to ask, maybe as part of the import wizard, which of the mismatched languages to import settings for.

But in any case, issuing no message when nothing was imported is a serious bug IMHO.