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

Use latest JDKs in CI #1880

Merged
merged 1 commit into from
May 5, 2021
Merged

Use latest JDKs in CI #1880

merged 1 commit into from
May 5, 2021

Conversation

vasilmkd
Copy link
Member

@vasilmkd vasilmkd commented Apr 4, 2021

Jabba, the JDK downloader that we depend on through our Github Actions configuration has not been updated in quite some time, and hacks like this need to be done to get a hold of the latests JDK releases in any of the major versions (8, 11, 16, Graal).

@djspiewak
Copy link
Member

@vasilmkd Is this ready?

@vasilmkd
Copy link
Member Author

It works, but the GH actions are now ugly, the JDK strings are too long and cut off. Is that an issue?

@djspiewak
Copy link
Member

the JDK strings are too long and cut off. Is that an issue?

I'm okay with it as long as we can look at build failures and tell which case we're in. It's unfortunate, but Jabba really needs to be updated.

@vasilmkd
Copy link
Member Author

You can inspect the GH action task for setting up Java... not ideal. Maybe close it and we should look for an alternative?

@djspiewak
Copy link
Member

Yeah this isn't super-great. It's not intolerable though. Let's leave it open and hunt for another option. I think Jabba allows us to define an upstream definitions repo with an environment variable or something?

@vasilmkd
Copy link
Member Author

vasilmkd commented Apr 11, 2021

Does coursier support installation of JDKs?

Edit: It's still done through Jabba.

@keynmol
Copy link

keynmol commented Apr 14, 2021

@vasilmkd
Copy link
Member Author

@djspiewak Would you accept a PR to sbt-github-actions which adds a new key that is a Map[String, String] mapping human readable Java strings like adopt@11 for presentation purposes to the URI of the download. The key would be used in the GH Actions frontend, and the value would be passed to jabba?

@larsrh
Copy link
Contributor

larsrh commented Apr 18, 2021

Jabba now has support for JDK 16:

$ coursier java --available | grep 1.16
openjdk:1.16.0
zulu:1.16.0-0

@vasilmkd
Copy link
Member Author

I see. But it's not from AdoptOpenJDK.

@durban
Copy link
Contributor

durban commented Apr 23, 2021

Apparently Coursier can also install a JVM by using its own index (or probably any index). The necessary option is --jvm-index cs (the default is --jvm-index jabba).

$ cs java --available --jvm-index cs | grep 1.16
adopt:1.16
adopt-debugimage:1.16
adopt-jre:1.16
adopt-testimage:1.16

@vasilmkd
Copy link
Member Author

Honestly this is what I've been looking for. Do you mind sharing a link to where this is documented? Thank you.

@durban
Copy link
Contributor

durban commented Apr 23, 2021

I don't think it's documented :-) I've found it in the source and experimented: https://github.com/coursier/coursier/blob/master/modules/jvm/src/main/scala/coursier/jvm/JvmIndex.scala. The --jvm-index option seems to accept "cs", "jabba", an URL, or I guess mvn coordinates (e.g., "io.get-coursier:jvm-index"). I don't know how the last one works exactly.

@djspiewak
Copy link
Member

Honestly seems like something we should try to handle in sbt-github-actions. I don't mind using Coursier instead of Jabba directly to handle that installation, it's just going to require some reworking of the core build preamble.

@vasilmkd
Copy link
Member Author

Are you sure it doesn't require building a new GH action for this? I'd actually be willing to try to experiment with this and write it in Scala.js.

@djspiewak
Copy link
Member

Are you sure it doesn't require building a new GH action for this? I'd actually be willing to try to experiment with this and write it in Scala.js.

I mean, if you wanna try then go for it. :-D Everything that you can do in an action you can also do in a bit of bash dropped into an exec. Either way it's possible. :-) Since sbt-github-actions is already automatically generating and managing the preamble, we don't technically need a second mechanism of abstraction, though it is arguably cleaner to do so.

@vasilmkd
Copy link
Member Author

But we do use the olafurpg/setup-scala Action to do it, don't we?

@vasilmkd
Copy link
Member Author

vasilmkd commented May 3, 2021

Looks like the jabba index has been refreshed to include the latest JDKs.

@SethTisue
Copy link
Member

SethTisue commented May 3, 2021

(not familiar with what particular needs this repo might have, but:)

can you use actions/setup-java@v2 instead of setup-scala? all setup-scala gets you, to my knowledge, is nonstandard sbt launcher scripts

setup-java supports things like

    - uses: actions/setup-java@v2
      with:
        distribution: adopt
        java-version: ${{matrix.java}}

where matrix.java can be set to 8, 11, 16, etc.

@vasilmkd
Copy link
Member Author

vasilmkd commented May 3, 2021

Yeah, I've used setup-java in personal projects and ultimately it works the same, by delegating to the jabba tool.

We don't really have any special requirements. We "inherit" setup-scala because it is hard-coded in sbt-github-actions, for better or for worse. :)

@vasilmkd vasilmkd closed this May 5, 2021
@vasilmkd vasilmkd reopened this May 5, 2021
@vasilmkd vasilmkd closed this May 5, 2021
@vasilmkd vasilmkd reopened this May 5, 2021
@vasilmkd
Copy link
Member Author

vasilmkd commented May 5, 2021

AdoptOpenJDK 16 is finally available through Jabba. GraalVM 21.1 is also available but fails to install for some reason. I have opened an issue with Jabba.

@vasilmkd vasilmkd marked this pull request as ready for review May 5, 2021 12:24
@vasilmkd
Copy link
Member Author

vasilmkd commented May 5, 2021

I'm merging this because it only touches the build and it is important to build and test against the latest supported JDK.

@vasilmkd vasilmkd merged commit 35c9e1e into typelevel:series/3.x May 5, 2021
@vasilmkd vasilmkd deleted the java branch May 5, 2021 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants