Attempting to utilize Jenkins with Arm Development Studio 2022.2 to do some builds but the pipeline fails.
This is the command being run (based on the documentation):
C:\"Program Files"\Arm\"Development Studio 2022.2"\bin\armds_idec.exe -nosplash --launcher.suppressErrors -application com.arm.cmsis.pack.project.headlessbuild -data C:\git\workspace -import test_module\code -cleanBuild "Test_Project/Debug"
Here's the relevant log output:
11:46:07 Build Finished. 0 errors, 80 warnings. (took 21s.966ms)Armds_idec:Java was started but returned exit code=1-Xms1024m-Xmx2048m--add-opens=java.base/java.io=ALL-UNNAMED--add-opens=java.base/sun.nio.ch=ALL-UNNAMED--add-opens=java.base/java.lang=ALL-UNNAMED--add-opens=java.base/java.util=ALL-UNNAMED--add-opens=java.base/java.nio.charset=ALL-UNNAMED--add-opens=java.base/java.nio=ALL-UNNAMED--add-opens=java.base/java.lang.reflect=ALL-UNNAMED-Dnashorn.args=--no-deprecation-warning-Djava.class.path=C:\Program Files\Arm\Development Studio 2022.2\bin\..\sw\ide\\plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar-os win32-ws win32-arch x86_64-launcher C:\Program Files\Arm\Development Studio 2022.2\bin\..\sw\ide\armds_idec.exe-name Armds_idec--launcher.library C:\Program Files\Arm\Development Studio 2022.2\bin\..\sw\ide\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.400.v20211117-0650\eclipse_11602.dll-startup C:\Program Files\Arm\Development Studio 2022.2\bin\..\sw\ide\\plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar--launcher.overrideVmargs-application com.arm.cmsis.pack.project.headlessbuild-data C:\git\workspace-import test_module\code-cleanBuild Test_Project/Debug-vm C:\Program Files\Arm\Development Studio 2022.2\bin\..\sw\ide\\../java/bin/server/jvm.dll-vmargs-Xms1024m-Xmx2048m--add-opens=java.base/java.io=ALL-UNNAMED--add-opens=java.base/sun.nio.ch=ALL-UNNAMED--add-opens=java.base/java.lang=ALL-UNNAMED--add-opens=java.base/java.util=ALL-UNNAMED--add-opens=java.base/java.nio.charset=ALL-UNNAMED--add-opens=java.base/java.nio=ALL-UNNAMED--add-opens=java.base/java.lang.reflect=ALL-UNNAMED-Dnashorn.args=--no-deprecation-warning-Djava.class.path=C:\Program Files\Arm\Development Studio 2022.2\bin\..\sw\ide\\plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar
and the armds_ide.ini:
-startupplugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar--launcher.libraryplugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.400.v20211117-0650-vm../java/bin/server/jvm.dll-vmargs-Xms1024m-Xmx2048m--add-opens=java.base/java.io=ALL-UNNAMED--add-opens=java.base/sun.nio.ch=ALL-UNNAMED--add-opens=java.base/java.lang=ALL-UNNAMED--add-opens=java.base/java.util=ALL-UNNAMED--add-opens=java.base/java.nio.charset=ALL-UNNAMED--add-opens=java.base/java.nio=ALL-UNNAMED--add-opens=java.base/java.lang.reflect=ALL-UNNAMED-Dnashorn.args=--no-deprecation-warning
The only thing that was added to the .ini from stock was the -Xms and -Xmx options.
When running from the IDE, there are no errors when I close out. I tried the recommended eclipse option of using "-XX:-UseCompressedOops" but that produces a new error:
Opening 'Test_Project'.Invalid Arguments: [-XX:-UseCompressedOops, -cleanBuild, Test_Project/Debug, -no-indexer]Error: Unknown argument: -XX:-UseCompressedOops -cmsisRoot {path} CMSIS-Packs root directory -help prints the list of argumentsArmds_idec:Java was started but returned exit code=2
Also tried removing/modifying the Xms and Xmx options, setting JAVA_HOME, switching between the .dll and .exe for the -vm argument and even re-installing but no luck. The system where the project is to be run is clean: only has the java that was installed with the Arm Development Studio nor has any environment variables like JAVA_HOME set. The fails occurs whether I try to run through the pipeline or directly from a command prompt. The error also occurs when I try to run armds_idec on my local machine.
So adding verbose got the following put into the .log:
!ENTRY org.eclipse.cdt.managedbuilder.core 4 0 2023-05-25 11:38:46.111!MESSAGE Orphaned CDT build configuration [com.arm.eclipse.build.config.baremetal.exe.debug.1025481069.790460894]: parent extension cfg [com.arm.eclipse.build.config.baremetal.exe.debug.1025481069.790460894] not found!STACK 0java.lang.Exception at org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin.error(ManagedBuilderCorePlugin.java:232) at org.eclipse.cdt.managedbuilder.internal.core.Configuration.loadFromProject(Configuration.java:879) at org.eclipse.cdt.managedbuilder.internal.core.Configuration.<init>(Configuration.java:419) at org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider.load(ConfigurationDataProvider.java:405) at org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider.loadConfiguration(ConfigurationDataProvider.java:573) at org.eclipse.cdt.internal.core.settings.model.CConfigurationDescriptionCache.loadData(CConfigurationDescriptionCache.java:139) at org.eclipse.cdt.internal.core.settings.model.CProjectDescription.loadDatas(CProjectDescription.java:199) at org.eclipse.cdt.internal.core.settings.model.xml.XmlProjectDescriptionStorage.loadProjectDescription(XmlProjectDescriptionStorage.java:510) at org.eclipse.cdt.internal.core.settings.model.xml.XmlProjectDescriptionStorage.getProjectDescription(XmlProjectDescriptionStorage.java:240) at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescriptionInternal(CProjectDescriptionManager.java:427) at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescription(CProjectDescriptionManager.java:409) at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescription(CProjectDescriptionManager.java:403) at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescription(CProjectDescriptionManager.java:396) at org.eclipse.cdt.core.resources.RefreshScopeManager.loadSettings(RefreshScopeManager.java:474) at org.eclipse.cdt.core.resources.RefreshScopeManager.loadSettings(RefreshScopeManager.java:457) at org.eclipse.cdt.core.resources.RefreshScopeManager.<init>(RefreshScopeManager.java:111) at org.eclipse.cdt.core.resources.RefreshScopeManager.getInstance(RefreshScopeManager.java:93) at org.eclipse.cdt.internal.core.BuildRunnerHelper.refreshProject(BuildRunnerHelper.java:376) at org.eclipse.cdt.managedbuilder.core.ExternalBuildRunner.invokeExternalBuild(ExternalBuildRunner.java:149) at org.eclipse.cdt.managedbuilder.core.ExternalBuildRunner.invokeBuild(ExternalBuildRunner.java:73) at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.performExternalClean(CommonBuilder.java:1170) at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.clean(CommonBuilder.java:1111) at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.clean(CommonBuilder.java:1070) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:856) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:361) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:490) at org.eclipse.core.internal.resources.Project$1.run(Project.java:565) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:603) at org.eclipse.core.internal.resources.Project.build(Project.java:124) at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager$2.buildProject(ManagedBuildManager.java:4550) at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager$2.run(ManagedBuildManager.java:4518) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2333) at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager.buildConfigurations(ManagedBuildManager.java:4559) at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager.buildConfigurations(ManagedBuildManager.java:4439) at org.eclipse.cdt.managedbuilder.internal.core.HeadlessBuilder.buildConfigurations(HeadlessBuilder.java:322) at org.eclipse.cdt.managedbuilder.internal.core.HeadlessBuilder.start(HeadlessBuilder.java:690) at org.eclipse.cdt.managedbuilder.internal.headlessbuilderapp.HeadlessBuilderWrapper.start(HeadlessBuilderWrapper.java:131) 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:401) 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:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) at org.eclipse.equinox.launcher.Main.run(Main.java:1467)!ENTRY org.eclipse.cdt.core 1 0 2023-05-25 11:38:52.547!MESSAGE Indexed 'Test_Project' (161 sources, 264 headers) in 5.84 sec: 30,724 declarations; 134,101 references; 0 unresolved inclusions; 2 syntax errors; 0 unresolved names (0%)!ENTRY org.eclipse.core.resources 4 566 2023-05-25 11:39:43.019!MESSAGE Workspace was not properly initialized or has already shutdown.
Opening the project in ArmDS, there's no warning about anything being orphaned under debug configuration but apparently, this shows up under release now:
Orphaned configuration. No base extension cfg exists for com.arm.eclipse.build.config.baremetal.exe.debug.1025481069.609003989
Which is a slightly different version number than the one documented in the log file, same basefile though. I haven't changed any packages or plugins in the environment so I'm not sure how to check where this is getting pulled in.
Also, just to mention, if I remove suppressErrors, the only difference is that there is a pop-up with the java error at the end instead of just a dump of the error on the command line. No additional errors show up in the output.
Hi againAre you able to fix the orphaned configuration? You might need to remake the Eclipse project afresh to do so.If you can fix it, it'd be interesting to find out whether that was the cause of the exit code=1 error you see.Have you tried a simple "Hello World" project in your Jenkins flow?Stephen
A customer requirement is to use the legacy 5.0.6u3 toolchain, downloaded from the Arm site, and anything that gets set to use that toolchain seems to produce the "orphaned toolchain" complaint under release. But that's on my machine. I'll try rebuilding the project from scratch in a clean environment to see if that doesn't work as I honestly don't remember if I already tried that.
So it turns out that the default configuration I selected was wrong. At first, when I went into "Build Configurations->Manage", I was given a choice of Debug or Release for "Default configuration." When I went back in, I was given the options of "Debug : Arm Compiler 5" or "Release : Arm Compiler 5". I choose the debug option and all seemed well, at least within the GUI environment. Going back in for a third time, I saw options for "Arm Compiler 5" and "Arm Compiler 5.06u3" with the second being for the 5.0.6u3 toolchain I installed. Not sure why I had to jump through hoops to find it but as soon as I rebuild my configurations using the defaults for 5.0.6u3, the "orphaned toolchain" and Java errors all went away. So the problem does appear to be that the toolchain specific plugins/versions didn't get picked up when I first went to create the project. I even went back into a copy of the project and the toolchain specific version will not show up until after I create at least one temp configuration using the "Arm Compiler 5" version. The workaround to create the temp from the old default and then use the correct/toolchain default once it appears has worked every time so far.
Glad to hear that you've resolved the issue, and thanks for sharing the solution with the community :)
Stephen