Trouble with iOS/CircleCI

I get the below error for sonarcloud/scan on circleCI. Could someone point in right direction?

#!/bin/bash --login -eo pipefail
set -e
VERSION=4.1.0.1829
SONAR_TOKEN=$SONAR_TOKEN
SCANNER_DIRECTORY=/tmp/cache/scanner
export SONAR_USER_HOME=$SCANNER_DIRECTORY/.sonar
OS="linux"
echo $SONAR_USER_HOME

if [[ ! -x "$SCANNER_DIRECTORY/sonar-scanner-$VERSION-$OS/bin/sonar-scanner" ]]; then
  curl -Ol https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$VERSION-$OS.zip
  unzip -qq -o sonar-scanner-cli-$VERSION-$OS.zip -d $SCANNER_DIRECTORY
fi

chmod +x $SCANNER_DIRECTORY/sonar-scanner-$VERSION-$OS/bin/sonar-scanner
chmod +x $SCANNER_DIRECTORY/sonar-scanner-$VERSION-$OS/jre/bin/java

$SCANNER_DIRECTORY/sonar-scanner-$VERSION-$OS/bin/sonar-scanner

/tmp/cache/scanner/.sonar
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 40.4M  100 40.4M    0     0  10.8M      0  0:00:03  0:00:03 --:--:-- 10.8M
/tmp/cache/scanner/sonar-scanner-4.1.0.1829-linux/bin/sonar-scanner: line 64: /private/tmp/cache/scanner/sonar-scanner-4.1.0.1829-linux/jre/bin/java: cannot execute binary file
/tmp/cache/scanner/sonar-scanner-4.1.0.1829-linux/bin/sonar-scanner: line 64: /private/tmp/cache/scanner/sonar-scanner-4.1.0.1829-linux/jre/bin/java: Undefined error: 0

Exited with code exit status 1

CircleCI received exit code 1

Details regarding the project:

Hello @dk-smart-tech,

Sorry for the late reply.
The CircleCI orb currently doesn’t support running on macosx CircleCI executors. Would it be possible to change

macos:
  xcode "11.6.0"

to

docker:
  - image: cimg/base:2020.01

(The cimg/base:2020.01 is the base image offered by CircleCI and it should contain everything necessary to run the scanner).

This change only needs to be done for the job that runs the sonarcloud scanner, all your other jobs can run on macosx executors.

1 Like