Bug 322160 - Stale build-variable values are used during build
Summary: Stale build-variable values are used during build
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-09 13:09 EDT by Baltasar Belyavsky CLA
Modified: 2020-09-04 15:19 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 Baltasar Belyavsky CLA 2010-08-09 13:09:05 EDT
Build Identifier: 3.6.0 [I20100608-0911]

The managedbuild model and the core build model get out of sync for one build cycle when build-variables are changed on the workspace level.  So, in effect, the core build model ends up "caching" a stale build-variable value for one build cycle.

Reproducible: Always

Steps to Reproduce:
1. Create a simple Cygwin C project and add any simple C file to it.
2. Define a new workspace-level build-variable, named "TEST_VAR", through the Preferences > C/C++ > Build > Build Variables page.  Assign a string value "value1" to it.
3. Modify the project's Compiler > Symbols > Defined Symbols build-option to reference the build-variable "TEST_VAR".
4. Build the project.
-> The project is correctly built with the "-Dvalue1" flag passed to the compiler.
5. Go back to Preferences, and change the value of "TEST_VAR" to "value2".
6. Clean the project, and build it.
-> The project is now incorrectly built, still passing "-Dvalue1" to the compiler.
7. Clean the project and build it again.
-> Now the project is built correctly with "-Dvalue2".

The stale build-variable value is observed every time, and only for one build-cycle - the ScannerConfigBuilder seems to be causing the models to sync-up after the first build-cycle.

We're currently working around this bug by explicitly invoking "ManagedBuildManager.updateCoreSettings(project, null, true);" on the PRE_BUILD event to cause the models to synchronize before the build.