We use the published CircleCI orb for performing the Sonarcloud scanning of our Lambda functions before deployment. We are in the process of migrating to the Arm64 architecture to take advantage of AWS cost savings and performance improvements. In order to properly compile the code, the CircleCI executor itself must also be Arm64. So we are now experiencing failures on the Sonarcloud step of our pipeline because it appears the downloaded binary is failing to execute.
The pipeline output shows:
/tmp/cache/scanner/sonar-scanner-22.214.171.12406-linux/bin/sonar-scanner: 66: exec: /tmp/cache/scanner/sonar-scanner-126.96.36.19906-linux/jre/bin/java: Exec format error
Exited with code exit status 126
Can you please advise if there is a workaround for this or if a new version of the orb is on the way?
Can you please post your entire CircleCI YML file?
We have our own private orb called
priv-code-analysis that wraps the sonarcloud orb with some other commands. I’ve trimmed our config file down to the relevant jobs/workflows and also included the orb source. The executor specified is the CircleCI published Arm64 version of their python3.9-node convenience image.
name: Install packages
pip install 'pipenv<2022.8.13'
- priv-aws-auth/setup-credentials: &setup-credentials
name: Setup Credentials
pipeline-number: << pipeline.number >>
name: Merge in <<pipeline.parameters.main-branch>>
- Setup Credentials
name: Sonar Scan (With Coverage Reports)
name: Pipenv sync
command: pipenv sync --dev
name: Run Coverage
pipenv run coverage run -m pytest
pipenv run coverage xml
pipenv run coverage report -m
- Merge in <<pipeline.parameters.main-branch>>
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
This orb provides functionality to perform testing and inspection of code quality
by using SonarCloud.
By default yarn test is executed, but any set of custom commands can be executed by providing
a list of steps to the test-command parameter.
Some additional parameters are supported to affect how test results are stored and integrated
with CircleCI, any SonarCloud specific configuration should be saved in a sonar-project.properties
file located in the root of the repository.
- image: cimg/node:14.17
This job run test scripts, analyzes the results and sends them to SonarCloud
executor: << parameters.executor >>
Testing artifacts found under the artifact-path parameter are moved
to this location under the ARTIFACTS tab of the job in CircleCI
The path that contains any testing artifacts created that can be attached
to the ARTIFACTS tab of the job in CircleCI
The Slack channel to notify when the job fails. If left blank, no
notification will be sent.
Define executor to run this job
The CircleCI resource class to use when running the job
A list of CircleCI steps to execute in preparation of testing/scanning
- run: yarn test
A list of CircleCI steps to execute in order to run tests and generate
code coverage reports for SonarQube scanning.
The path that contains any test results that you would like to be evaluated
under the TESTS tab of the job in CircleCI
Path to attach workspace
resource_class: << parameters.resource-class >>
at: << parameters.workspace-path >>
- steps: << parameters.scan-prep >>
- steps: << parameters.test-command >>
condition: << parameters.artifact-path >>
destination: << parameters.artifact-dest >>
path: << parameters.artifact-path >>
condition: << parameters.test-results-path >>
path: << parameters.test-results-path >>
condition: << parameters.channel-name >>
channel: << parameters.channel-name >>