Npm package for sonar-scanner always downloads x64 which gives linking errors on arm

Hello,
We have recently been switching many of our build/test servers to arm64 based build nodes. On these nodes, we’re encountering issues running the sonar-scanner when pulled in via npm. We’ve tried the latest 4.3.0 version of the npm package (Release 4.3.0 · SonarSource/sonar-scanner-npm · GitHub). This pulls in sonar-scanner-6.2.1.4610-linux-x64, while we would expect the aarch64 variant. When looking at the code, we can see that it always defaults to the x64 variant, which was also remarked upon in the PR review (SCANNPM-51 Update Scanner CLI to 6.2.1 by henryju · Pull Request #171 · SonarSource/sonar-scanner-npm · GitHub). This behavior is undesirable when running arm64 natively or in docker without a compatibility layer.

The observed error is x86_64-binfmt-P: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory indicating an x86 binary, which we confirmed to be indeed the case.

Can the code be updated to check the architecture being used and respect that or allow for the architecture to be specified via configuration?

Hello @Vincent_Van_Gestel,

thank you for reporting this. I’ve created a ticket to handle this.

What version of SQS are you using? The scanner cli will in any case be skipped in latest SQS versions or if you are using SQC.

Cheers,
Victor