Matrix-Builds always fails when number of executors is more than 1


I have setup a jenkins controller and some agents (Linux and Windows).
Every project uses a pipeline via a Jenkinsfile.
Within the build-matrix I have 4 targets (‘Release’, ‘Debug’, ‘Test’ and ‘Prototype’). The source-code is mainly written in C. The result of every target will be a hex-file which could be flashed to a controller.
When I use 1 as the number available executors on the windows-based agent where the compiler is installed, the code compiles correctly. So it’s not a code issue.
As soon as I set the number of executors to 2 or more, the exact same code breaks at different points with weird syntax errors or missing libs.

The windows agent is a Windows 2019 Server as a virtual machine.
I already seperated build-workspaces, but the problem persists. I can confirm that every branch/target is in a seperate folder within the build-workspace, so no overlapping things here.

Does anyone every expierenced such strange behaviour?
I struggle with this for a while now and have no idea what to look for - any hints are very welcome.

Things I will try next:

  1. Setup another windows-based build-agent on my laptop to verify that the problem does not exist there - so I can confirm that it is not an issue of jenkins.

Thanks in advance

Which build tool are you using to build the project? Is it msbuild?
I can vaguely remember from long time ago, that when using visual studio build tools one had to set some env variable in each build. Otherwise some tool was running in the background that was started by the first build and then parallel builds used the same instance. When the first build finished the tool was killed by Jenkins basically crashing the other parallel builds.

1 Like