Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Headless build on 2021-03 building multiple times
Headless build on 2021-03 building multiple times [message #1840615] Tue, 20 April 2021 17:01 Go to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Hi,

I'm trying to use the headless build feature on Eclipse 2021-03, but I'm finding that it's building 4 times for each configuration. Can anyone suggest why this might be?

For background, I have multiple projects I'm trying to build, but I'm doing one at a time using a command of the form:

eclipse --launcher.suppressErrors -nosplash -data", eclipseWorkspace -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import <projectPath> -build <projectName>/<config>


What I'm getting out (timestamped lines only), for example for the Debug configuration of my BitFieldTest project is of the form:

10:27:19 **** Build of configuration Debug for project BitFieldTest ****
10:27:20 Build Finished. 0 errors, 0 warnings. (took 854ms)
10:27:26 **** Build of configuration Debug for project BitFieldTest ****
10:27:27 Build Finished. 0 errors, 0 warnings. (took 922ms)
10:27:27 **** Build of configuration Debug for project BitFieldTest ****
10:27:28 Build Finished. 0 errors, 0 warnings. (took 695ms)
10:27:28 **** Build of configuration Debug for project BitFieldTest ****
10:27:28 Build Finished. 0 errors, 0 warnings. (took 724ms)


Does anyone have any clue why it would go through this 4 times?

I don't know if this is relevant (it certainly shouldn't be, but seems worth mentioning in case it's more than a coincidence), but each project has 4 configurations; Debug, Release, DebugCross, ReleaseCross. However I'm explicitly providing the choice of configuration so expect it to be built only once.

[Updated on: Tue, 20 April 2021 17:07]

Report message to a moderator

Re: Headless build on 2021-03 building multiple times [message #1840616 is a reply to message #1840615] Tue, 20 April 2021 17:36 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Interestingly, this behaviour is different if I add the -no-indexer option; if I do that, the project appears to only be built once (as it should be).

Sounds like a bug to me.
Re: Headless build on 2021-03 building multiple times [message #1855054 is a reply to message #1840615] Mon, 26 September 2022 14:59 Go to previous messageGo to next message
Sebastián Paniagua is currently offline Sebastián PaniaguaFriend
Messages: 1
Registered: September 2022
Junior Member
Sorry, this message must be coming a bit late.

I had the same behaviour in a headless build and the reason was that I had the "Build all configurations in each project" option selected.

When I changed to "Build active configuration in each project" the behaviour disappeared.

This option can be found in the menu "Window" -> "Preferences" -> "C/C++" -> "Build".

Kind Regards
Re: Headless build on 2021-03 building multiple times [message #1864052 is a reply to message #1855054] Wed, 13 March 2024 15:05 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Sebastián Paniagua wrote on Mon, 26 September 2022 10:59
Sorry, this message must be coming a bit late.

I had the same behaviour in a headless build and the reason was that I had the "Build all configurations in each project" option selected.

When I changed to "Build active configuration in each project" the behaviour disappeared.

This option can be found in the menu "Window" -> "Preferences" -> "C/C++" -> "Build".

Kind Regards


Apologies that it's taken me so long to reply. Thank you for that suggestion. I can't remember if I tried it or not now, but things have been going ok-ish for a while with the settings I now have.
Re: Headless build on 2021-03 building multiple times [message #1864081 is a reply to message #1840615] Thu, 14 March 2024 14:09 Go to previous messageGo to next message
Ashoka Dev is currently offline Ashoka DevFriend
Messages: 2
Registered: March 2024
Junior Member
John McCabe wrote on Tue, 20 April 2021 17:01
Hi,

I'm trying to use the headless build feature on Eclipse 2021-03, but I'm finding that it's building 4 times for each configuration. Can anyone suggest why this might be?

For background, I have multiple projects I'm trying to build, but I'm doing one at a time using a command of the form:

eclipse --launcher.suppressErrors -nosplash -data", eclipseWorkspace -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import <projectPath> -build <projectName>/<config>


What I'm getting out (timestamped lines only), for example for the Debug configuration of my BitFieldTest project is of the form:

10:27:19 **** Build of configuration Debug for project BitFieldTest ****
10:27:20 Build Finished. 0 errors, 0 warnings. (took 854ms)
10:27:26 **** Build of configuration Debug for project BitFieldTest ****
10:27:27 Build Finished. 0 errors, 0 warnings. (took 922ms)
10:27:27 **** Build of configuration Debug for project BitFieldTest ****
10:27:28 Build Finished. 0 errors, 0 warnings. (took 695ms)
10:27:28 **** Build of configuration Debug for project BitFieldTest ****
10:27:28 Build Finished. 0 errors, 0 warnings. (took 724ms)


Does anyone have any clue why it would go through this 4 times?

I don't know if this is relevant (it certainly shouldn't be, but seems worth mentioning in case it's more than a coincidence), but each project has 4 configurations; Debug, Release, DebugCross, ReleaseCross. However I'm explicitly providing the choice of configuration so expect it to be built only once.

Could you please share your current settings since I have some issues with headless build. Thanks in advance :)
Re: Headless build on 2021-03 building multiple times [message #1864083 is a reply to message #1864081] Thu, 14 March 2024 14:50 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
eclipse --launcher.suppressErrors -nosplash -data <path to a workspace> -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import <relative path to a specific project> -build <ProjectName/ProjectConfiguration> -markerType cdt -no-indexer


All the stuff in <..> needs to be filled in with your own paths and settings. E.g., if you have a project "MyProj" in "./projects/MyProj" with a build configuration "Debug", and wanted to use a workspace "WS" in your current directory, it would be something like:

eclipse --launcher.suppressErrors -nosplash -data WS -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import projects/MyProj -build MyProj/Debug -markerType cdt -no-indexer


As I think I mentioned, I never managed to get anything sensible to happen by using wildcards to import all the projects under my current directory, so I have a Python script that works out a build order based on the contents of each project's .project file (i.e. the "references" section) and imports and builds each project and each configuration one at a time.

TBH though - we hope to be able to introduce CMake instead as soon as possible.

HTH
Re: Headless build on 2021-03 building multiple times [message #1864102 is a reply to message #1864083] Sat, 16 March 2024 08:01 Go to previous messageGo to next message
Ashoka Dev is currently offline Ashoka DevFriend
Messages: 2
Registered: March 2024
Junior Member
John McCabe wrote on Thu, 14 March 2024 14:50
eclipse --launcher.suppressErrors -nosplash -data <path to a workspace> -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import <relative path to a specific project> -build <ProjectName/ProjectConfiguration> -markerType cdt -no-indexer


All the stuff in <..> needs to be filled in with your own paths and settings. E.g., if you have a project "MyProj" in "./projects/MyProj" with a build configuration "Debug", and wanted to use a workspace "WS" in your current directory, it would be something like:

eclipse --launcher.suppressErrors -nosplash -data WS -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import projects/MyProj -build MyProj/Debug -markerType cdt -no-indexer


As I think I mentioned, I never managed to get anything sensible to happen by using wildcards to import all the cinema hd projects under my current directory, so I have a Python script that works out a build order based on the contents of each project's .project file (i.e. the "references" section) and imports and builds each project and each configuration one at a time.

TBH though - we hope to be able to introduce CMake instead as soon as possible.

HTH

Thank you so much friend. Cheers!
CMake is interesting

[Updated on: Sun, 17 March 2024 19:25]

Report message to a moderator

Re: Headless build on 2021-03 building multiple times [message #1865004 is a reply to message #1864102] Tue, 23 April 2024 09:35 Go to previous message
Audrey Fadel is currently offline Audrey FadelFriend
Messages: 2
Registered: March 2024
Junior Member
I'm sorry for the delay in getting back to you. I appreciate your suggestion. I'm not entirely sure if I've already tried it, but things have been somewhat okay with the current settings I've been using.

[Updated on: Wed, 01 May 2024 14:35]

Report message to a moderator

Previous Topic:C++20 concepts support
Next Topic:Disassembly view question
Goto Forum:
  


Current Time: Wed Jul 24 02:18:37 GMT 2024

Powered by FUDForum. Page generated in 0.03916 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top