Buildwrapper on macOS works on local system, but throws error on CI

until now I was executing the buildwrapper for sonarQube locally on my mac and it was running fine without any problem. Now I moved it to our CI system where it also runs on a mac Buildagent. But on the agent it crashes with an unknown reason:

[Step 2/7] perl: posix_spawn: /private/tmp/sonarsource-build-wrapper-cache-504/usr/bin/perl5.18: Unknown error: -1

the log file of the wrapper just ends with exit code 2:

Tue May 04 18:57:42 2021: executable: </private/tmp/sonarsource-build-wrapper-cache-504/usr/bin/perl>
Tue May 04 18:57:42 2021: argv[0]:
Tue May 04 18:57:42 2021: argv[1]: </usr/local/bin/lcov>
Tue May 04 18:57:42 2021: argv[2]: <–directory>
Tue May 04 18:57:42 2021: argv[3]: <.>
Tue May 04 18:57:42 2021: argv[4]: <–zerocounters>
Tue May 04 18:57:42 2021: skipping process with pid: 92550
Tue May 04 18:57:42 2021: finalizing json file
Tue May 04 18:57:42 2021: returned with code: 2

I use to call the wrapper in the following way:

sonarqube/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir sonarqubewrapperlogs make -j10

has anyone an idea what could be wrong here? Running it without the wrapper works fine.

Hi @the_frank ,

there is an issue with Perl 5.18, could you try to install a different version of Perl before calling build-wrapper? i.e. with brew install perl and checking output of perl --version before build-wrapper invocation.

Thanks Massimo, I installed a newer version of perl and was using this with success. What I’m still not really clear about is the fact that my local machine and the build server was using the exact same perl version 5.18.4 with different results.

Hi @the_frank,

thank you for the update.

different macOS version perhaps?

No, both have the exact same MacOS version (latest security patch 10.15.7) and the perl version used was the bundled one with MacOS.

Ok, interesting. I created CPP-3111 to track the issue.