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

Action fails at aarch64 machine since action.yml hardcodes X64 #63

Closed
vlsi opened this issue Nov 27, 2023 · 6 comments · Fixed by #73
Closed

Action fails at aarch64 machine since action.yml hardcodes X64 #63

vlsi opened this issue Nov 27, 2023 · 6 comments · Fixed by #73
Assignees
Labels
bug Something isn't working

Comments

@vlsi
Copy link

vlsi commented Nov 27, 2023

See https://github.com/pgjdbc/pgjdbc/actions/runs/6997219349/job/19033952407#step:5:14

Can the action support arm linux as well?

JAVA=$JAVA_HOME_17_X64/bin/java

Here's the log (note there's JAVA_HOME_17_ARM64 environment variable):

Run oracle-actions/setup-java@7a0114d66dbd02646abd345c3395b34c148e6126
  with:
    website: jdk.java.net
    release: [2](https://github.com/pgjdbc/pgjdbc/actions/runs/6997140560/job/19033784475#step:5:2)2
    version: latest
    install: true
  env:
    ACTIONS_STEP_DEBUG: true
    ACTIONS_RUNNER_DEBUG: true
    TZ: America/New_York
    JAVA_HOME: /home/pgjdbc/actions-runner/_work/_tool/Java_Oracle_jdk/17/arm64
    JAVA_HOME_17_ARM64: /home/pgjdbc/actions-runner/_work/_tool/Java_Oracle_jdk/17/arm64
Run JAVA=$JAVA_HOME_17_X64/bin/java
  JAVA=$JAVA_HOME_17_X64/bin/java
  DOWNLOAD=$GITHUB_ACTION_PATH/src/Download.java
  if [ ! -z "" ]; then
    $JAVA \
      -Dinstall-as-version="" \
      $DOWNLOAD \
      
  else
    $JAVA \
      -Dinstall-as-version="" \
      $DOWNLOAD \
      jdk.java.net \
      22 \
      latest
  fi
  shell: /bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    ACTIONS_STEP_DEBUG: true
    ACTIONS_RUNNER_DEBUG: true
    TZ: America/New_York
    JAVA_HOME: /home/pgjdbc/actions-runner/_work/_tool/Java_Oracle_jdk/17/arm64
    JAVA_HOME_17_ARM64: /home/pgjdbc/actions-runner/_work/_tool/Java_Oracle_jdk/17/arm64
/home/pgjdbc/actions-runner/_work/_temp/948b854[3](https://github.com/pgjdbc/pgjdbc/actions/runs/6997140560/job/19033784475#step:5:3)-3de5-[4](https://github.com/pgjdbc/pgjdbc/actions/runs/6997140560/job/19033784475#step:5:4)01f-aa19-[6](https://github.com/pgjdbc/pgjdbc/actions/runs/6997140560/job/19033784475#step:5:6)e[9](https://github.com/pgjdbc/pgjdbc/actions/runs/6997140560/job/19033784475#step:5:9)6ade9ce4d.sh: line [10](https://github.com/pgjdbc/pgjdbc/actions/runs/6997140560/job/19033784475#step:5:10): /bin/java: No such file or directory
@vlsi vlsi changed the title Action fails at aarch64 machine since action.yml hard-codes x86 Action fails at aarch64 machine since action.yml hardcodes x86 Nov 27, 2023
vlsi added a commit to vlsi/oracle-actions-setup-java that referenced this issue Nov 27, 2023
Try JAVA_HOME_17_ARM64 first, and fallback to JAVA_HOME_17_X86

Fixes oracle-actions#63
@vlsi vlsi changed the title Action fails at aarch64 machine since action.yml hardcodes x86 Action fails at aarch64 machine since action.yml hardcodes X64 Nov 27, 2023
@vlsi
Copy link
Author

vlsi commented Nov 27, 2023

Here's a workaround:

      uses: oracle-actions/setup-java@7a0114d66dbd02646abd345c3395b34c148e6126 # v1.3.2
      env:
        # ARM machines miss JAVA_HOME_17_X64, however, the action uses the variable
        JAVA_HOME_17_X64: ${{ env.JAVA_HOME_17_ARM64 || env.JAVA_HOME_17_X64 }}

@vlsi
Copy link
Author

vlsi commented Nov 27, 2023

Note that JAVA_HOME_17_ARM64 is not reliable.
setup-java creates variable JAVA_HOME_17_ARM64 when called without explicit architecture: ..., and it creates JAVA_HOME_17_AARCH64 when architecture: aarch64 is specified in action call 🤷

@sormuras
Copy link
Member

With setup-java creates variable [...] you refer to the underlying actions/setup-java right?

@sormuras sormuras added the bug Something isn't working label Nov 27, 2023
@vlsi
Copy link
Author

vlsi commented Nov 27, 2023

By the way, it looks like JAVA_HOME_17_... does not even exist on pgjdbc self-hosted runner (no idea why), so I had to install Java 17 first, then call oracle-action/setup-java to download Java 22, and then re-install Java 17 with actions/setup-java so it restores Java 17 as the default one.

actions/setup-java always sets the installed Java as the default one: actions/setup-java#560

sormuras added a commit that referenced this issue Feb 1, 2024
sormuras added a commit that referenced this issue Feb 1, 2024
* Support running on ARM64 machines

Closes #63
Closes #64
Closes #71
@sormuras
Copy link
Member

sormuras commented Feb 1, 2024

@vlsi and @sureshg - I went ahead and added support for ARM-based runners. Tests look good so far: https://github.com/oracle-actions/setup-java/actions/runs/7738950766

Can you please double-check using either the commit hash c9a099b12bd9a6c0d491c63b76e99b190a621def or main version of this action? Thanks in advance.

@sureshg
Copy link

sureshg commented Feb 1, 2024

@sormuras it's working fine on macos-14 (M1)..thanks for the quick fix.

  • Action Log:
10s
Run oracle-actions/setup-java@main
Run JAVA=$JAVA_HOME_[1](https://.../actions/runs/77457234162/job/211234587168#step:3:1)7_X64/bin/java
openjdk 17.0.9 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode)
Archive openjdk-23-ea+7_macos-aarch64_bin.tar.gz in file:///Users/runner/.oracle-actions/setup-java/1b7d4742/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
3 participants