Community
Participate
Working Groups
1. Add some user environment variables in project A. 2. In context menu of project B select "Build Configurations"->Manage. 3. Use "New" and "Import from projects" the configuration of project A where environment variables were added. Save the new config. 4. Check the new configuration in properties. No user environment variables propagated from the source configuration. The problem seems to be that the new configuration description is created in the way where no copying CConfigurationSpecSettings happens.
*** cdt git genie on behalf of Andrew Gvozdev *** bug 358605: Cosmetics. Renamed some local variables, fixed warnings, changed wording in error message. [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=6d6ddb397dd432871769786b3574d063fb5fe2cd
Created attachment 203858 [details] patch James, it's a small patch but if you have time - I'd appreciate a quick look to check if it's the way to do it.
Looks fine to me Andrew
Thanks for the fast review, pushed to master.
*** cdt git genie on behalf of Andrew Gvozdev *** bug 358605: No environment variables imported to new cfg while importing configuration from another project in Manage Configurations dialog [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=6a63d0325fc79e06d9ccc28658005758b344a492
Don't have an eclipse in front of me, so just checking: When you create a new configuration based on one in another project, do all the setting get copied over on creation? I.e. If the original source project goes away, does the copied configuration continue to work? That would be my only worry...
(In reply to comment #6) > Don't have an eclipse in front of me, so just checking: > When you create a new configuration based on one in another project, do all the > setting get copied over on creation? I.e. If the original source project goes > away, does the copied configuration continue to work? > That would be my only worry... AFAICS they are. New configuration for the same project is created the same way: if (b_cloneFromProject.getSelection()) { ICConfigurationDescription base = ManagedBuildManager.getDescriptionForConfiguration(parentConfig); cfgDes = des.createConfiguration(id, newName, base); cfgDes.setDescription(newDescription); } else if (b_importFromOtherProject.getSelection()) { The settings are supposed to be copied in this case, aren't they? My worry is if for some objects references are copied instead of cloning but that would be equally bad for copying a configuration in the same project, won't it?
(In reply to comment #7) If the base configuration is a built in configuration, or a configuration in the same project, that would be OK, as the base configurations are in the plugin.xml (which are always available), and configurations in the same project live in the same .cproject. As I understood it, configurations inherit all their setting by default from their parent/superclass. Only settings which are explicitly changed are overwritten in the XML. This means that if you don't change the optimisation level in your configuration, and the default changes, then the project gets the new default. It's worth trying: - In Project A Debug config set Optimisation to -O2 - Create a config in Project B copies ProjectA/Debug - Does Project B's configuration show -O2 (and is it in the project B's .cproject)? - Delete Project A, does Project B still work, can you open & close it without error? The environment is somewhat different to the MBS settings, as it isn't inherited in this way, it's just copied out and saved in the EclipsePreferences.
(In reply to comment #8) > (In reply to comment #7) > It's worth trying: > - In Project A Debug config set Optimisation to -O2 > - Create a config in Project B copies ProjectA/Debug > - Does Project B's configuration show -O2 (and is it in the project B's > .cproject)? > - Delete Project A, does Project B still work, can you open & close it without > error? Thanks for additional test cases, just tried that. Seems to be working as it should. No exceptions in the log either.