Reputation: 21
I am in the process of implementing a Continuous Integration Server for our embedded application built with the GNU-ARM toolchain with the GNU-ARM-ECLIPSE plugin. Therefore, I need to compile our CDT project from the command line on the server (I want to compile the Debug, Release and UnitTests builds, and then run the tests).
I was planning to use the Eclipse Headless builds (see here).
The problem I am getting is that after building, I don't get the prompt back (on windows CMD or Powershell), and so I cannot run the tests. And also, the CI server complains that the build was not successful, but everything builds fine. If I kill the command after it is completed, I can run the tests, but there is no acceptable way I could do that with a script or batch file when on the server.
It turns out that this is a Windows only problem, because on the mac or on linux, I don't have that problem. Our server is a TFS server, therefore it has to work on Windows.
Also, it might be related to how the eclipse project is setup because I tried it with a basic Hello-World project, and it works fine. Any hints or help would be greatly appreciated.
Upvotes: 2
Views: 1297
Reputation: 473
I had the same issue with STM32CubeIDE which uses eclipse. The culprit is the indexer which runs after the build (silently, except when running it verbose). The indexer is not needed for a headless build in my opinion. (I found it in an example here: https://stackoverflow.com/a/76571159/15307950). In my case the headless build did not hang permanently, but at least 20-30 seconds for a medium sized project and 5 seconds for a small hello world project. With a more complex project and a slower CPU I guess it can hang for a few minutes.
By adding the parameter -no-indexer
to your command the problem goes away.
For me the working command was:
C:\ST\STM32CubeIDE_1.11.2\STM32CubeIDE\stm32cubeidec.exe -no-indexer --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data %workspace_folder% -import %PROJECT_DIR% -build %PROJECT_NAME%/%BUILD_TYPE%
For you it is probably:
eclipse -no-indexer --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data {myWorkspace} -import {myProject} -build "project/target"
Upvotes: 0
Reputation: 74
I had the same issue as yours and resolved it by changing options order (don't ask me why).
The cmd that have your problem :
eclipse --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data {myWorkspace} -import {myProject} -build "project/target"
the cmd that did work for me :
eclipse --launcher.suppressErrors -nosplash -data {myWorkspace} -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import {myProject} -build "project/target"
Upvotes: -1