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

Bug 334799

Summary: CDT headlessbuilder can't handle the dependent projects correctly
Product: [Tools] CDT Reporter: plmkop <plmkop>
Component: cdt-build-managedAssignee: Project Inbox <cdt-build-managed-inbox>
Status: CLOSED INVALID QA Contact: Chris Recoskie <recoskie>
Severity: major    
Priority: P3 CC: cdtdoug, jamesblackburn+eclipse, plmkop
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description plmkop CLA 2011-01-19 10:48:46 EST
Build Identifier: 20100917-0705

When use the headlessbuilder to build a workset which contains one main projects and several dependent projects, such as main project is projmain and there are two dependent projects projlib and projzend.

When use command :
eclipse -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild  -import path-to-projmain -data /tmp/workspace.13309 -cleanBuild  projmain --launcher.suppressErrors -vmargs -Xms128m -Xmx512m

It don't build the dependent projects projlib and projzend.

And if change command to :


eclipse -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild  -import path-to-projlib -import path-to-projzend -import path-to-projmain -data /tmp/workspace.13309 -cleanBuild projlib -cleanBuild projzend -cleanBuild  projmain --launcher.suppressErrors -vmargs -Xms128m -Xmx512m

The build order is like projlib projmain and projzend, it always follows the project name's letter sequence order.

So the build would fail when build a main project has dependent projects.

Current workaround:

manage the project dependency in makefile.target in the main project which like following

projlib :
       command to build this project

projzend :
       command to build this project

projmain : projlib projzend





Reproducible: Always

Steps to Reproduce:
1. set up several projects which one main project dependens on other project and the main project name shouldn't be the last one, like A, B and C, set A or B as main project.
2. use the eclipse headlessbuild  command to build the main project.

Headlessbuild command line arguments are 

/**
 * A headless builder for CDT with additional features.
 *
 * IApplication ID: org.eclipse.cdt.managedbuilder.core.headlessbuild
 * Provides:
 *   - Import projects :                       -import     {[uri:/]/path/to/project}
 *   - Import all projects in the tree :       -importAll  {[uri:/]/path/to/projectTreeURI}
 *   - Build projects / the workspace :        -build      {project_name_reg_ex/config_name_reg_ex | all}
 *   - Clean build projects / the workspace :  -cleanBuild {project_name_reg_ex/config_name_reg_ex | all}
 *   - Add Include path to build :             -I          {include_path}
 *   - Add Include file to build :             -include    {include_file}
 *   - Add preprocessor define to build :      -D          {prepoc_define}
 *   - Replace environment variable in build : -E          {var=value}
 *   - Append environment variable to build :  -Ea         {var=value}
 *   - Prepend environment variable to build : -Ep         {var=value}
 *   - Remove environment variable in build :  -Er         {var}
 *   - Replace a tool option value:            -T          {toolid} {optionid=value}
 *   - Append to a tool option value:          -Ta         {toolid} {optionid=value}
 *   - Prepend to a tool option value:         -Tp         {toolid} {optionid=value}
 *   - Remove a tool option:                   -Tr         {toolid} {optionid=value}
 *
 * Build output is automatically sent to stdout.
 * @since 6.0

3.
Comment 1 James Blackburn CLA 2011-01-19 10:52:37 EST
(In reply to comment #0)
> Steps to Reproduce:
> 1. set up several projects which one main project dependens on other project
> and the main project name shouldn't be the last one, like A, B and C, set A or
> B as main project.
> 2. use the eclipse headlessbuild  command to build the main project.

Have you set references between the project configurations: 
 Project Properties > C/C++ General > Paths & Symbols > References
?

If you don't do this, CDT won't know to build references first.
Comment 2 plmkop CLA 2011-01-19 11:28:33 EST
Sorry, you are right that I didn't do that before, thanks for you information.