Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350499

Summary: Changing C/C++ project toolchain away from Cross GCC loses Cross GCC option settings.
Product: [Tools] CDT Reporter: William Swanson <WilliamRSwanson>
Component: cdt-build-managedAssignee: Project Inbox <cdt-build-managed-inbox>
Status: RESOLVED FIXED QA Contact: Jonah Graham <jonah>
Severity: minor    
Priority: P3 CC: cdtdoug, torbjorn.svensson, yevshif
Version: 8.0   
Target Milestone: 10.3.0   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/179786
https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=3c58527d534b44c1f67fe5c85d28be90e81789a8
Whiteboard:

Description William Swanson CLA 2011-06-27 16:26:17 EDT
Build Identifier: M20110210-1200

Seen on Eclipse 3.6.2, with CDT 7.0.2 and the crossgcc plugin version 1.0.0.201103141311 installed.

To reproduce,
- create a C or C++ project with the "Cross GCC" toolchain selected,
and fill in the "prefix" and "path" Cross GCC options.
- in the project properties dialog, go to the Settings page and confirm the options are set
- now go to the Toolchain page, and change the toolchain to anything other
than Cross GCC.
- on the Settings page, the Cross GCC fields are now blank, and one cannot recover their values even if one switches back to the Cross GCC toolchain.

While it's true in general that toolchain options are reset to the defaults when switching toolchains, the Cross GCC options are a special case because they define the cross-build toolchain being used. Silently losing their values can cause a project to start building incorrectly for no obvious reason.

The particular case in mind is where the Cross GCC options are generated by a wizard: if a curious user happens to go into the Toolchain page and experiment with changing the toolchain, they can unwittingly lose information that may be non-trivial for them to recreate, and not even be aware they've done so.

Possible resolutions: either preserve the Cross GCC options in the project metadata even if they are not used by the current toolchain, so they can be redisplayed, or at least display a warning when the user edits the toolchain that doing so will reset the Settings page to the default values for the new toolchain, and may make their project no longer build correctly.


Reproducible: Always
Comment 1 Eclipse Genie CLA 2021-04-24 05:21:16 EDT
New Gerrit change created: https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/179786