Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support arm64 runners #768

Open
nirmalsunny opened this issue Aug 21, 2024 · 8 comments
Open

Support arm64 runners #768

nirmalsunny opened this issue Aug 21, 2024 · 8 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@nirmalsunny
Copy link

Describe the bug

The action is failing on arm64 based runners despite using the same config and node version as x64.

Run paambaati/[email protected]
  with:
    coverageCommand: go test -race -coverpkg=./... -coverprofile=coverage.out ./...
    workingDirectory: .
    debug: true
    coverageLocations: coverage.out:gocov
    prefix: github.com/<org>/<repo-name>
    verifyDownload: true
    verifyEnvironment: true
  env:
    GO_VERSION: 1.[2](https://github.com/<org>/<repo-name>/actions/runs/10487987931/job/29049524157#step:5:2)3.0
    CC_TEST_REPORTER_ID: ***

/opt/actions-runner/_work/<repo-name>/<repo-name>/cc-reporter before-build
/opt/actions-runner/_work/<repo-name>/<repo-name>/cc-reporter: 1: �ELF����: not found
/opt/actions-runner/_work/<repo-name>/<repo-name>/cc-reporter: 1: ��: not found
/opt/actions-runner/_work/<repo-name>/<repo-name>/cc-reporter: 1: ��: not found
/opt/actions-runner/_work/<repo-name>/<repo-name>/cc-reporter: 1: �������c�������c�����c��$: not found
/opt/actions-runner/_work/<repo-name>/<repo-name>/cc-reporter: 1: cannot open ���: No such file
/opt/actions-runner/_work/<repo-name>/<repo-name>/cc-reporter: 2: Syntax error: word unexpected (expecting ")")
Error: The process '/opt/actions-runner/_work/<repo-name>/<repo-name>/cc-reporter' failed with exit code 2
/opt/actions-runner/_work/_actions/paambaati/codeclimate-action/v8.0.0/node_modules/@actions/exec/lib/toolrunner.js:592
                error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
                        ^

Error: The process '/opt/actions-runner/_work/<repo-name>/<repo-name>/cc-reporter' failed with exit code 2
    at ExecState._setResult (/opt/actions-runner/_work/_actions/paambaati/codeclimate-action/v8.0.0/node_modules/@actions/exec/lib/toolrunner.js:592:25)
    at ExecState.CheckComplete (/opt/actions-runner/_work/_actions/paambaati/codeclimate-action/v8.0.0/node_modules/@actions/exec/lib/toolrunner.js:575:18)
    at ChildProcess.<anonymous> (/opt/actions-runner/_work/_actions/paambaati/codeclimate-action/v8.0.0/node_modules/@actions/exec/lib/toolrunner.js:469:27)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:[3](https://github.com/<org>/<repo-name>/actions/runs/10487987931/job/29049524157#step:5:3)05:5)

Node.js v20.13.1
Error: 🚨 CC Reporter before-build checkin failed!

Node information

$ node -v
v18.20.4

$ node -e 'console.log(require("os").arch())'
arm64

Version of codeclimate-action you're using
v8.0.0

Expected behavior
The action to work the same way as it does on x64 systems.

Additional context
Using self-hosted runners. v6 works.

@nirmalsunny nirmalsunny added the bug Something isn't working label Aug 21, 2024
@paambaati
Copy link
Owner

paambaati commented Aug 21, 2024

@nirmalsunny Thanks for reporting! I'm looking for a specific line –

Downloading CC Reporter from ...

in the output log, and it is missing.

Can you get me that URL from your workflow logs please? You can get them after setting ACTIONS_STEP_DEBUG environment variables to true and then re-running your workflow – see https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging#enabling-runner-diagnostic-logging

Note that this information is already required according to the bug report template.

@nirmalsunny
Copy link
Author

Thank you for the reply.

Downloading CC Reporter from https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64

It looks wrong file is being downloaded.

@paambaati
Copy link
Owner

paambaati commented Aug 22, 2024

@nirmalsunny Interesting, this action uses the arch package to detect the runtime architecture; I'll need your help to take a closer look.

Can you execute this on your runner and paste the output here?

// npm i arch
var arch = require('arch')
console.log(arch())

Additionally, just to make sure you're using the right version of Node, can you also run these and paste the output here?

node -p "process.arch"
node -p "process.platform"
node -p "process.release"
node -p "process.config.variables.host_arch"

@paambaati paambaati added the need-more-info Need additional information to debug/reproduce label Aug 22, 2024
@nirmalsunny
Copy link
Author

$ node -e 'console.log(require("os").arch())'
arm64

$ node -e "var arch = require('arch'); console.log(arch());"
x64

$ node -p "process.arch"
arm64

$ node -p "process.platform"
linux

$ node -p "process.release"
{
  name: 'node',
  lts: 'Hydrogen',
  sourceUrl: 'https://nodejs.org/download/release/v[18](https://github.com/<org>/<repo>/actions/runs/105063558290/job/291055832049#step:4:19).20.4/node-v18.[20](https://github.com/<org>/<repo>/actions/runs/105063558290/job/291055832049#step:4:21).4.tar.gz',
  headersUrl: 'https://nodejs.org/download/release/v18.20.4/node-v18.20.4-headers.tar.gz'
}

$ node -p "process.config.variables.host_arch"
arm64

@paambaati
Copy link
Owner

@nirmalsunny Thanks. I notice that you're using the x64 build of Node.js – shouldn't you be using https://nodejs.org/download/release/v18.20.4/node-v18.20.4-linux-arm64.tar.gz instead?

The problem here is that the arch module is reporting the architecture based on the Node.js binary and the platform it was built for – in your case, you're using the x64 version, when in fact, it should be arm64.

@paambaati paambaati added question Further information is requested and removed need-more-info Need additional information to debug/reproduce labels Aug 22, 2024
@alejandrocelada-wiser
Copy link

alejandrocelada-wiser commented Sep 24, 2024

Same issue for me. I bumped from version v3.2.0 to v9.0.0. But I had to rollback since it seems that this error is present. This is the our runner info:

node -e "const arch = require('arch'); console.log(arch())" -> x64
node -p "process.arch"- > arm64
node -p "process.platform" -> linux
node -p "process.release" -> {
  name: 'node',
  lts: 'Hydrogen',
  sourceUrl: 'https://nodejs.org/download/release/v18.20.4/node-v18.20.4.tar.gz',
  headersUrl: 'https://nodejs.org/download/release/v18.20.4/node-v18.20.4-headers.tar.gz'
}
node -p "process.config.variables.host_arch" -> arm64 

In my case I don't have the ability to modify the runner, could we have a parameter where we hardcode the file instead of it being based on the node version? Or maybe in another previous step I should install the node version base on arm64?

@nirmalsunny
Copy link
Author

Sorry for the delay.

I have updated the images to make sure that arm64 version of node is installed, and propagating those images to the runners needed some time.

I have also updated the cc to v9. But the error or the outputs from the commands above have not been changed. Either my images did not change or something wrong with node/arch?

I second the suggestion of having an input to specify architecture if it cannot be assumed. Thank you.

@paambaati
Copy link
Owner

Thanks for the details, folks. I will add an option to override the download URL in a forthcoming release.

@paambaati paambaati added enhancement New feature or request and removed question Further information is requested labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants