Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338318 - Restore default properties of a single source file results in clean and full build of the project
Summary: Restore default properties of a single source file results in clean and full ...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 8.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on: 193286
Blocks:
  Show dependency tree
 
Reported: 2011-02-26 19:41 EST by Alex Freidin CLA
Modified: 2020-09-04 15:18 EDT (History)
3 users (show)

See Also:


Attachments
The quick fix I've done against CDT 7.0.1. (6.98 KB, patch)
2012-03-06 10:55 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 Alex Freidin CLA 2011-02-26 19:41:36 EST
Build Identifier: M20100909-0800

Steps to reproduce:
1. Create a C/C++ project with several source files
2. Change a project property of a single file, e.g. optimization level
3. Build the project
4. Open that file properties and click Restore Defaults
5. Build the project
Instead of building the file whose properties were restored to defaults, the project is first cleaned and then fully built. Reproducible for internal and external builder. 

Reproducible: Always
Comment 1 Alex Freidin CLA 2011-02-27 08:56:10 EST
Related to bug 193286, but with different scenario. When a file is restored to defaults, the MBS calls Configuration.removeResourceConfiguration() that sets rebuildNeeded=true. Instead, it should record the resource that changed and build it.
Comment 2 James Blackburn CLA 2011-02-27 10:12:04 EST
(In reply to comment #1)
> Related to bug 193286, but with different scenario. When a file is restored to
> defaults, the MBS calls Configuration.removeResourceConfiguration() that sets
> rebuildNeeded=true. Instead, it should record the resource that changed and
> build it.

It should be sufficient to just IResource.touch() the file.  It'll then be rebuilt at the next build.  Also needs a test...
Comment 3 Alex Freidin CLA 2012-03-06 10:53:00 EST
(In reply to comment #2)
> (In reply to comment #1)
> > Related to bug 193286, but with different scenario. When a file is restored to
> > defaults, the MBS calls Configuration.removeResourceConfiguration() that sets
> > rebuildNeeded=true. Instead, it should record the resource that changed and
> > build it.
> 
> It should be sufficient to just IResource.touch() the file.  It'll then be
> rebuilt at the next build.  Also needs a test...

I think the file will be rebuilt in all project configurations then, not only the changed one. Are we OK with that?

Some time ago I applied a quick fix that changes the time stamp of the corresponding object as was done in a patch for bug 193286.
Comment 4 Alex Freidin CLA 2012-03-06 10:55:30 EST
Created attachment 212138 [details]
The quick fix I've done against CDT 7.0.1.