Bug 331027 - CDT project is totally rebuilt two times when switching of build configuration
Summary: CDT project is totally rebuilt two times when switching of build configuration
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 7.0.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on: 331031
Blocks:
  Show dependency tree
 
Reported: 2010-11-24 10:05 EST by David Pochet CLA
Modified: 2020-09-04 15:21 EDT (History)
6 users (show)

See Also:


Attachments
Patch (936 bytes, patch)
2012-03-06 11:22 EST, Alex Freidin CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Pochet CLA 2010-11-24 10:05:33 EST
Use case: in workspace (or project) Indexer preferences, change the *Build configuration for the indexer* default to *Use active build configuration*
From there, when switching the active build configuration in the toolbar hammer button, the project is *totally* rebuilt, *two times*
Normal behavior, which is indeed confirmed when the preference is set to the default (fixed build configuration for indexer), should be that once the build configurations are at least built one time, switching the active build configuration should trigger the build only one time, without rebuilding anything (nothing has changed...)
Comment 1 James Blackburn CLA 2010-11-24 10:21:57 EST
Are you complaining about the indexer being rebuilt, or the project being rebuilt when changing configuration?
Comment 2 David Pochet CLA 2010-11-24 10:25:08 EST
The project is rebuilt (.c files are compiled again, but they haven't changed)
Comment 3 Alex Freidin CLA 2010-12-22 08:57:02 EST
Also ran across this issue. With Cygwin toolchain, if the indexer is bound to active configuration:
*) The build runs CLEAN, then does full build, then  calls "make all" again. Nothing happens at the latter build, since nothing changed.

If the indexer is bound to Debug configuration
*) The build button does CLEAN + BUILD every time, after changing active build configuration.

In both cases, CLEAN should never be invoked as nothing changed in the project sources or settings.
Comment 4 Alex Freidin CLA 2011-02-28 19:09:10 EST
There is an improvement in HEAD. I observe the following with both Internal and External (make) builders:

- When the indexer is set to a fixed configuration, then switching between configurations does not cause a full rebuild of the project. OK.

- When the indexer is set to an active configuration in the WORKSPACE settings, then switching between configurations cause the project to be rebuilt. Bug.

- The double build attempt is no longer reproducible. 

- The root cause for full rebuild is the Scanner Configuration Builder. If it is disabled in Project > Properties > Builders, then the project is not rebuilt after switching configuration. 
The Scanner calls ManagedBuildManager.updateCoreSettings() that eventually updates the project description with null builder, so at next build, a new builder is instantiated and it triggers a clean build.
Comment 5 Alex Freidin CLA 2012-03-06 11:22:59 EST
Created attachment 212142 [details]
Patch

This resolved the bug for me in CDT 7.0.1, but I've yet to check if this has no side effects on the scanner discovery.