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 does not ensure that sbt is installed on Ubuntu 24 #712

Open
2 of 5 tasks
jsoref opened this issue Dec 18, 2024 · 5 comments
Open
2 of 5 tasks

Setup Java does not ensure that sbt is installed on Ubuntu 24 #712

jsoref opened this issue Dec 18, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@jsoref
Copy link

jsoref commented Dec 18, 2024

Description:
Notice of breaking changes for GitHub Actions warned that certain packages would not be present in Ubuntu 24.04, this included sbt.

This was tripped on by this repository and worked around by pinning backwards (from ubuntu-latest to ubuntu-22.04):

Unfortunately, anyone who legitimately expected "setup-java" to set up java for use with sbt which is listed as a supported feature of the actions/setup-java repository:

- Caching dependencies managed by sbt.

... doesn't get a working sbt environment.

Task version:
Specify the task version actions/setup-java@v4, as in:
https://github.com/GarnerCorp/build-actions/blob/f3a79ac52d53e8b2218381ae5dd240619ed9eacf/scala/action.yml#L129-L134

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

  1. Create a workflow that runs-on: ubuntu-latest or runs-on: ubuntu-24.04
  2. Add a step that either uses: actions/setup-java@v4 or uses: GarnerCorp/build-actions/scala@0cc885d8117f6bb9c89dc99a34f5edebeac115cf
  3. If you aren't using the build-actions/scala action which automatically uses sbt, run sbt

Expected behavior:
sbt should work

Actual behavior:
sbt: not found

@jsoref jsoref added bug Something isn't working needs triage labels Dec 18, 2024
@gowridurgad
Copy link

Hello @jsoref,
Thank you for creating this issue. We will investigate it and provide feedback as soon as we have some updates.

@mahabaleshwars mahabaleshwars self-assigned this Dec 19, 2024
@boydsa92
Copy link

boydsa92 commented Dec 19, 2024

We are facing the same issue
/home/runner/work/_temp/ff2d4e86-705c-42c5-98eb-92311951ff46.sh: line 2: sbt: command not found

@mahabaleshwars
Copy link
Contributor

Hi @jsoref,

You're absolutely right that sbt is currently not included in Ubuntu 24.04. The Runner Image team has made cuts to the list of included packages in order to maintain our SLA for free disk space. More details here: actions/runner-images#10636.

Since sbt is not part of the runner image, CI workflows were failing, which is why the workflows have been updated.

The setup-java action provides the environment for sbt, and including sbt by default depends on the runner image configuration.

You can still install sbt manually using sudo apt-get install sbt, but currently, it isn't working with Ubuntu 24.04. Below is a workaround for the issue.

     run: |
       echo ""deb https://repo.scala-sbt.org/scalasbt/debian all main"" | sudo tee /etc/apt/sources.list.d/sbt.list
       echo ""deb https://repo.scala-sbt.org/scalasbt/debian /"" | sudo tee /etc/apt/sources.list.d/sbt_old.list
       curl -sL ""https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823"" | sudo apt-key add
       sudo apt-get update
       sudo apt-get install sbt

Let me know if it helps resolve your problem.

@jsoref
Copy link
Author

jsoref commented Dec 20, 2024

first, your sample code is buggy and you really shouldn't suggest it -- the "" evaluate to empty.
second, apt-key is deprecated and has been since at least ubuntu 22.04 -- suggesting it anywhere is a horrible idea.

third, this action is designed to support sbt -- each consumer of this action shouldn't have to try to avoid making the mistakes that you included in your sample code (or the various other mistakes that may be present or properly maintain it for when the key for ubuntu changes). Or the various other problems entailed here.

@SethTisue
Copy link

SethTisue commented Dec 20, 2024

The maintainers of sbt have made this action available: https://github.com/sbt/setup-sbt cc @eed3si9n

So all that users need to do is add uses: sbt/setup-sbt@v1 and you're good again.

mpollmeier added a commit to joernio/joern that referenced this issue Dec 23, 2024
sbt is no longer included by default in the ubuntu 24 runner
https://github.com/sbt/setup-sbt
actions/setup-java#712 (comment)
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

5 participants