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

setup-java@v4 setup for sbt failing on macOS with line 1: sbt: command not found #627

Closed
Christewart opened this issue Apr 25, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@Christewart
Copy link

Christewart commented Apr 25, 2024

This seemingly broke overnight, i'm attempting to setup the build with this

      - name: Setup Scala
        uses: actions/setup-java@v4
        with:
          distribution: 'adopt'
          java-version: '21'
          cache: 'sbt'

and the build is failing with

sbt coverage cryptoTestJVM/test coreTestJVM/test secp256k1jni/test zmq/test appCommonsTest/test asyncUtilsTestJVM/test chainTest/test dlcNodeTest/test appServerTest/test
/Users/runner/work/_temp/5e05e0e3-d7eb-40c9-aacb-dbf00977b77b.sh: line 1: sbt: command not found
Error: Process completed with exit code 127.

You can see the PR here: bitcoin-s/bitcoin-s#5546

Direct link to a failed build: https://github.com/bitcoin-s/bitcoin-s/actions/runs/8838483817/job/24269887223?pr=5546

EDIT: Note, this only fails on mac builds, linux builds are fine with this setup.

@Christewart Christewart added bug Something isn't working needs triage labels Apr 25, 2024
@HarithaVattikuti
Copy link
Contributor

Hello @Christewart
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

@AuroraLaghi
Copy link

I also encountered the same problem, only for macOS.

@prabhu
Copy link

prabhu commented Apr 27, 2024

brew install sbt workaround works. Looks like even php has disappeared from macOS runners.

Christewart added a commit to Christewart/bitcoin-s-core that referenced this issue Apr 29, 2024
Christewart added a commit to bitcoin-s/bitcoin-s that referenced this issue Apr 29, 2024
…install sbt (#5555)

* Try 'brew install sbt' as workaround to actions/setup-java#627

* Try downgrading github ci runner for mac to get a intel mac build

* Fix intel mac bitcoind download hashes

* Revert macOS CI runner
@mahabaleshwars mahabaleshwars self-assigned this May 7, 2024
Christewart added a commit to Christewart/bitcoin-s-core that referenced this issue May 9, 2024
Christewart added a commit to Christewart/bitcoin-s-core that referenced this issue May 9, 2024
Christewart added a commit to bitcoin-s/bitcoin-s that referenced this issue May 9, 2024
* Try to fix release build to workaround actions/setup-java#627

* try to fix os name

* Revert triggers
@mdedetrich
Copy link

Also experiencing the same issue

@mahabaleshwars
Copy link
Contributor

SBT is not included in the macOS 13 and macOS 14 Github Hosted Runner. Please refer to this source for confirmation.
If you need to use SBT in your workflow, you can add a step to install it manually.
Here's an example with Homebrew:

- name: Setup SBT
  run: |
    echo ""Installing SBT...""
    brew install sbt

This will install SBT on the runner for the duration of the workflow.

@mkurz
Copy link

mkurz commented May 13, 2024

Ran into the same problem, switched to macos-12 for now:

@mkurz
Copy link

mkurz commented May 13, 2024

The GitHub Actions macOS 13 and 14 runner images do not come with preinstalled sbt anymore and the GitHub team will not add them back anymore, see these closed issues:

More details can be found here as well:

IMHO this issue can be closed, because it's not the fault of the setup-java actions.
From now on you have to install sbt yourself with brew install sbt

@mahabaleshwars
Copy link
Contributor

Hello @Christewart, as previously noted, setup-java is functioning properly. The issue has surfaced due to modifications with the macos-13 and 14 runners. We recommend applying the solution we provided to resolve your issue. We're moving forward with closing this issue, but please feel free to contact us if you face any other challenges.

@eed3si9n
Copy link

I've created sbt/setup-sbt to workaround this - https://eed3si9n.com/setup-sbt/. sbt runner script seems to be missing from ubuntu-24.04 image as well, so eventually it might go away from all images.

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

No branches or pull requests

8 participants