codeql-action icon indicating copy to clipboard operation
codeql-action copied to clipboard

Linux ARM: java/bin/java: Exec format error

Open hfhbd opened this issue 11 months ago • 2 comments

I updated my GitHub Action workflow from Github hosted Linux x64 to Linux Arm, but now the codeql workflow fails:

Exit code was 126 and last log line was: 

/opt/hostedtoolcache/CodeQL/2.20.1/arm64/codeql/codeql: 142: /opt/hostedtoolcache/CodeQL/2.20.1/arm64/codeql/tools/linux64/java/bin/java: Exec format error.

Job run: https://github.com/hfhbd/kobol/actions/runs/12814883028/job/35732341338

CodeQL Setup:

name: "CodeQL"

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-24.04-arm
    permissions:
      contents: read
      security-events: write

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with:
          distribution: 'temurin'
          java-version: 21
      - uses: gradle/actions/setup-gradle@v4

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v3
        with:
          languages: kotlin
          build-mode: manual

      - name: Build with Gradle
        run: ./gradlew -Dorg.gradle.daemon=false --no-build-cache classes

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v3

hfhbd avatar Jan 16 '25 18:01 hfhbd

👋 @hfhbd : as noted in CodeQL's system requirements, CodeQL is not compatible with Linux Arm. I would advise to keep the CodeQL workflow running on x86_64, even if you update other workflows to use Arm.

redsun82 avatar Jan 17 '25 08:01 redsun82

@redsun82 Thanks, but it is a little bit unexpected given the ARM support for macOS/Apple Silicon.

Also do you/GitHub plan to add a native feature for an action.yml to mention supported os and archs to get an error when GitHub evaluates the workflow file and check outs all action yml files? It could be incorporated into the immutable action that uses docker and its supported platform manifest entry 🤔

hfhbd avatar Jan 17 '25 08:01 hfhbd