cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE 1.14.0 - Headless Builds broken? Workspace is already closed or not ready yet

idefix2000
Associate II

Hey All!

I just wanted to port my CICD chain to STM32CubeIDE1.14.0 and it fails. 

How to reproduce:

 

# /opt/st/stm32cubeide_1.14.0/headless-build.sh -import .

Stm32cubeide:
An error has occurred. See the log file
/home/xxx/.eclipse/com.st.stm32cube.ide.mcu.rcp.product_1.14.0_139063252_linux_gtk_x86_64/configuration/1704954145171.log.

 

$ cat /home/xxx/.eclipse/com.st.stm32cube.ide.mcu.rcp.product_1.14.0_139063252_linux_gtk_x86_64/configuration/1704954145171.log
!SESSION 2024-01-11 07:22:25.094 -----------------------------------------------
eclipse.buildId=Version 1.14.0
java.version=17.0.8.1
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import .
Command-line arguments:  -os linux -ws gtk -arch x86_64 -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import .
 
!ENTRY org.eclipse.osgi 4 0 2024-01-11 07:22:25.604
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Workspace is already closed or not ready yet. Consider tracking the org.eclipse.core.resources.IWorkspace service (using your favorite technique, e.g. Declarative Services, ServiceTracker, Blueprint, ...) instead of calling the static method here to prevent such issues!
at org.eclipse.core.resources.ResourcesPlugin.getWorkspace(ResourcesPlugin.java:502)
at org.eclipse.cdt.managedbuilder.internal.headlessbuilderapp.HeadlessBuilderWrapper.start(HeadlessBuilderWrapper.java:114)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
at org.eclipse.equinox.launcher.Main.main(Main.java:1432)

Running builds using the graphical frontend works fine.

STM32CubeIDE 1.12.1 headless builds works fine.

 

Thank you!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Oskar_H
Senior

It seems your command line is omitting the parameter to indicate the path to the workspace.

Try this : ./headless-build.sh -data path_to_workspace -import path_to_project

View solution in original post

4 REPLIES 4
Oskar_H
Senior

It seems your command line is omitting the parameter to indicate the path to the workspace.

Try this : ./headless-build.sh -data path_to_workspace -import path_to_project

That's it! Thanks for help!

Rim LANDOLSI
ST Employee

Hello @idefix2000 and welcome to the community,

 

For more information on headless build, see section 2.3.3.3 in the User Guide.

 

Thanks,

Rim

Oskar_H
Senior

@Rim LANDOLSI  the link to User Guide in your message does not work.

As the error message output by the headless-build script is completely foolish and does not help at all to understand the issue, could it be possible to improve it in a next version ?