Search code examples
eclipsegitlabcontinuous-integrationgitlab-cistm32cubeide

STM32CubeIDE Headless build in gitlab's CI/CD problem


I'm trying to perform a headless build for our gitlab's pipeline. However, I encountered some problems with it.

Firstly, I want to mention that the build process went smoothly before, but then as I need to change the name of the project, problem arises with the pipeline.

So far, I have managed to change all the required changed in the .cproject, .project and other references to the old project name. When I tried to perform a build and even a debug session from my PC (via STM32CubeIDE v1.10.1), it went perfectly fine without any problems.

The same goes with building the project via a headless build process manually from a linux machine (the docker image of my pipeline and STM32CubeIDE V1.10.1). However, when I tried to run it automatically from Gitlab's runner, it failed saying:

URI: file:/builds/6tyu7Drk/0/path/projName is not valid in the workspace!

The steps for my successful manual headless build:

git clone http://address_of_repo/projName.git /builds/6tyu7Drk/0/path/projName
cd /builds/6tyu7Drk/0/path/projName
git checkout BRANCH_NAME
/opt/st/stm32cubeide_1.10.1/headless-build.sh -import .
/opt/st/stm32cubeide_1.10.1/headless-build.sh -cleanBuild ProjName

The YAML file for my unsuccessful build, although it was working before I changed the project name:

/opt/st/stm32cubeide_1.10.1/headless-build.sh -import . #creates a workspace

The response from my build server:

Running with gitlab-runner 16.7.0 (xxxxxx)
  on build server 6tyu7Drk, system ID: s_dddddddddddd
Preparing the "shell" executor
Using Shell (bash) executor...
Preparing environment
Running on ddddddddd...
Getting source from Git repository
Fetching changes...
Initialized empty Git repository in /builds/6tyu7Drk/0/path/projName/.git/
Created fresh repository.
Checking out af7ab01a as detached HEAD (ref is refs/merge-requests/131/head)...
$ cd $CI_PROJECT_DIR
$ /opt/st/stm32cubeide_1.10.1/headless-build.sh -import .
URI: file:/builds/6tyu7Drk/0/path/projName is not valid in the workspace!
Stm32cubeide:
JVM terminated. Exit code=1
/opt/st/stm32cubeide_1.10.1//plugins/com.st.stm32cube.ide.jre.linux64_2.2.0.202203101208/jre/bin/java
-Dosgi.requiredJavaVersion=1.8
[email protected]/STM32CubeIDE/workspace_1.10.1
-Declipse.buildId=Version 1.10.1
-DproductMaturityGrade=mm
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Xms256m
-Xmx1024m
-jar /opt/st/stm32cubeide_1.10.1//plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar
-os linux
-ws gtk
-arch x86_64
-launcher /opt/st/stm32cubeide_1.10.1/stm32cubeide
-name Stm32cubeide
--launcher.library /opt/st/stm32cubeide_1.10.1//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.400.v20211117-0650/eclipse_11600.so
-startup /opt/st/stm32cubeide_1.10.1//plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar
--launcher.overrideVmargs
-exitdata 23
-application org.eclipse.cdt.managedbuilder.core.headlessbuild
-import .
-vm /opt/st/stm32cubeide_1.10.1//plugins/com.st.stm32cube.ide.jre.linux64_2.2.0.202203101208/jre/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.8
[email protected]/STM32CubeIDE/workspace_1.10.1
-Declipse.buildId=Version 1.10.1
-DproductMaturityGrade=mm
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Xms256m
-Xmx1024m
-jar /opt/st/stm32cubeide_1.10.1//plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar 
ERROR: Job failed: exit status 1

Can anyone help me with this issue? Thanks!


Solution

  • Solved by reinstalling the docker image. For some reason, the old built data is somehow still stored there, hence there is a conflict that I couldn't understand. Hence, by reinstalling the docker image, the build was successful.