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

Bug 327902

Summary: Dependent projects are not refreshed during headless build
Product: [Tools] CDT Reporter: Dmitry Kozlov <ddk>
Component: cdt-buildAssignee: cdt-build-inbox <cdt-build-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: cdtdoug, jamesblackburn+eclipse, sly_06, yevshif
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 309769    
Attachments:
Description Flags
Projects to reproduce problem.
none
Proposed patch none

Description Dmitry Kozlov CLA 2010-10-15 10:57:40 EDT
Build Identifier: 20100618-0524

When the command-line builder goes to build application which depends on others it finds that there are dependent projects, it then tries to build dependent projects but fails to refresh the projects before building. This results in a failed build.


Reproducible: Always

Steps to Reproduce:
1. Start IDE
2. Select a new and clean workspace.
3. Import the attached 3 projects into the workspace.
4. The workspace should automatically build the Debug build configuration (active configuration) for all projects. Given the project dependencies the build order is (a) the two static projects followed by (b) the application.
4. Exit the IDE
5. Start a terminal and change directories to the workspace directory.
6. Delete the build configuration directories, they contain data that should be recreated. e.g. rm -rf application/Debug static1/Debug static2/Debug
7. Build the application from the command line

Build fails.
Comment 1 Dmitry Kozlov CLA 2010-10-15 10:58:58 EDT
Created attachment 180964 [details]
Projects to reproduce problem.
Comment 2 James Blackburn CLA 2010-10-15 11:03:11 EDT
We've completely re-written the way dependent projects are built for 8.0. They'll be built by the platform, not implicitly as part of the top-level build.

There are a whole slew of bugs like this that will just disappear once this work has been committed back.
Comment 3 Dmitry Kozlov CLA 2010-10-15 11:17:02 EDT
Created attachment 180970 [details]
Proposed patch

I suggest to use new option -refresh which forces workspace to refresh before build.
Comment 4 James Blackburn CLA 2010-10-15 11:27:54 EDT
Actually I've got a patch very similar in our HeadlessBuilder, except it's non optional. Things go wrong - such as environment etc. from .settings if the WS isn't in sync. 

=> I think refresh before headless build should be the default.
Comment 5 Sylvain Boily CLA 2012-04-03 09:30:23 EDT
I have opened 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=375882
Which isn't 100% similar but might be related.

All the dependencies are getting build, but the order defined under 

'Project Settings->c/c++ General->Paths and Symbols->References'

isn't taken into consideration.

Here's a detailed explanation

http://www.eclipse.org/forums/index.php/mv/msg/313603/825548/