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.
Per the documentation you referenced, the import switch takes a directory, so what you have only works if I also had a directory called Test_Project that stored the .project and .cproject files, which I don't. It'll just fail again by saying it can't find that path if I try to add the project name. I did try absolute paths in case there was some sort of windows-ism that I was running afoul of but there was no change. As for splitting the operations up, it imports without issue but I get the same error after running -cleanBuild.
Thanks for confirming that the import step is working OK. This narrows the problem to the build step and anything after that.And I've just realized that your first post showed "Build Finished.", so the import step was never the problem! Apologies for not spotting that.What output do you see (if anything) before the11:46:07 Build Finished. 0 errors, 80 warnings. (took 21s.966ms)You should see at least something like:14:10:12 **** Clean-only build of configuration Debug for project Test_Project ****make cleanclean ./src/Test_Project.o ./src/Test_Project.d Test_Project.axf' '14:10:13 Build Finished. 0 errors, 0 warnings. (took 329ms)14:10:13 **** Build of configuration Debug for project Test_Project ****make all'Building file: ../src/Test_Project.c''Invoking: Arm C Compiler for Embedded 6'armclang.exe --target=aarch64-arm-none-eabi -O0 -g -MD -MP -c -o "src/Test_Project.o" "../src/Test_Project.c"'Finished building: ../src/Test_Project.c'' ''Building target: Test_Project.axf''Invoking: Arm Linker 6'armlink.exe --info=sizes -o "Test_Project.axf" ./src/Test_Project.o'Finished building target: Test_Project.axf'' '14:10:14 Build Finished. 0 errors, 0 warnings. (took 1s.332ms)Do you have any "post-build" steps in the project that could possible fail? Look in Project Properties > C/C++ Build > Settings > Build Steps.
11:46:07 Build Finished. 0 errors, 80 warnings. (took 21s.966ms)
14:10:12 **** Clean-only build of configuration Debug for project Test_Project ****
make clean
clean ./src/Test_Project.o ./src/Test_Project.d Test_Project.axf
' '
14:10:13 Build Finished. 0 errors, 0 warnings. (took 329ms)
14:10:13 **** Build of configuration Debug for project Test_Project ****
make all
'Building file: ../src/Test_Project.c'
'Invoking: Arm C Compiler for Embedded 6'
armclang.exe --target=aarch64-arm-none-eabi -O0 -g -MD -MP -c -o "src/Test_Project.o" "../src/Test_Project.c"
'Finished building: ../src/Test_Project.c'
'Building target: Test_Project.axf'
'Invoking: Arm Linker 6'
armlink.exe --info=sizes -o "Test_Project.axf" ./src/Test_Project.o
'Finished building target: Test_Project.axf'
14:10:14 Build Finished. 0 errors, 0 warnings. (took 1s.332ms)
I am getting the "correct" output from the build: No additional warnings outside some expected warning messages. As for post build, I do have some and they are calling some conversion tools which we did need to update with the newer version of Arm DS (had been using DS-5 previously). The change to make things work there was to use && to chain them together instead of separating them with semi-colons. Running the post build commands separately or as the chained command produces no errors (checked via %errorlevel%).
Are you trying to build a CMSIS-Pack based project?If not, please could you try-application org.eclipse.cdt.managedbuilder.core.headlessbuildinstead of-application com.arm.cmsis.pack.project.headlessbuildThat might help to reveal whether the problem is in our (Arm's) code or in CDT.Our headless application is derived from the CDT one, but should behave the same (for non-CMSIS-Pack based projects).
-application org.eclipse.cdt.managedbuilder.core.headlessbuild
-application com.arm.cmsis.pack.project.headlessbuild
Both built the project and both got the java error at the end. It looks like the only change was the order of the inputs being compiled: Same warnings for the same files on both runs, same commands, and so on, just a slightly different order.
Thanks for testing. That means the problem is not introduced in our (Arm's) com.arm.cmsis.pack.project.headlessbuild.1) Look for a .log file in <workspace>\.metadata. Does that reveal any problems?2) I'm puzzled that there is no diagnostic error message to accompany the exit code=1.Perhaps it is being redirected elsewhere, or to something that cannot display it.Try removing the "--launcher.suppressErrors" switch.3) The full list of options for armds_idec is given in its -help output:C:\Program Files\Arm\Development Studio 2022.2\bin>armds_idec.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -helpUsage: C:\Program Files\Arm\Development Studio 2022.2\bin\..\sw\ide\armds_idec.exe -data <workspace> -application org.eclipse.cdt.managedbuilder.core.headlessbuild [ OPTIONS ] -data {/path/to/workspace} -remove {[uri:/]/path/to/project} -removeAll {[uri:/]/path/to/projectTreeURI} Remove all projects under URI -import {[uri:/]/path/to/project} -importAll {[uri:/]/path/to/projectTreeURI} Import all projects under URI -build {project_name_reg_ex{/config_reg_ex} | all} -cleanBuild {project_name_reg_ex{/config_reg_ex} | all} -markerType Marker types to fail build on {all | cdt | marker_id} -no-indexer Disable indexer -verbose Verbose progress monitor updates -printErrorMarkers Print all error markers -I {include_path} additional include_path to add to tools -include {include_file} additional include_file to pass to tools -D {prepoc_define} addition preprocessor defines to pass to the tools -E {var=value} replace/add value to environment variable when running all tools -Ea {var=value} append value to environment variable when running all tools -Ep {var=value} prepend value to environment variable when running all tools -Er {var} remove/unset the given environment variable -T {toolid} {optionid=value} replace a tool option value in each configuration built -Ta {toolid} {optionid=value} append to a tool option value in each configuration built -Tp {toolid} {optionid=value} prepend to a tool option value in each configuration built -Tr {toolid} {optionid=value} remove a tool option value in each configuration built Tool option values are parsed as a string, comma separated list of strings or a boolean based on the options typeTry adding the "-verbose" switch. Does that reveal any additional information?
--launcher.suppressErrors
C:\Program Files\Arm\Development Studio 2022.2\bin>armds_idec.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -help
Usage: C:\Program Files\Arm\Development Studio 2022.2\bin\..\sw\ide\armds_idec.exe -data <workspace> -application org.eclipse.cdt.managedbuilder.core.headlessbuild [ OPTIONS ]
-data {/path/to/workspace}
-remove {[uri:/]/path/to/project}
-removeAll {[uri:/]/path/to/projectTreeURI} Remove all projects under URI
-import {[uri:/]/path/to/project}
-importAll {[uri:/]/path/to/projectTreeURI} Import all projects under URI
-build {project_name_reg_ex{/config_reg_ex} | all}
-cleanBuild {project_name_reg_ex{/config_reg_ex} | all}
-markerType Marker types to fail build on {all | cdt | marker_id}
-no-indexer Disable indexer
-verbose Verbose progress monitor updates
-printErrorMarkers Print all error markers
-I {include_path} additional include_path to add to tools
-include {include_file} additional include_file to pass to tools
-D {prepoc_define} addition preprocessor defines to pass to the tools
-E {var=value} replace/add value to environment variable when running all tools
-Ea {var=value} append value to environment variable when running all tools
-Ep {var=value} prepend value to environment variable when running all tools
-Er {var} remove/unset the given environment variable
-T {toolid} {optionid=value} replace a tool option value in each configuration built
-Ta {toolid} {optionid=value} append to a tool option value in each configuration built
-Tp {toolid} {optionid=value} prepend to a tool option value in each configuration built
-Tr {toolid} {optionid=value} remove a tool option value in each configuration built
Tool option values are parsed as a string, comma separated list of strings or a boolean based on the options type
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