-
Notifications
You must be signed in to change notification settings - Fork 49
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
Java 8 in CI: the end is nigh #215
Comments
Java 8 Active Support ended on March 31, which is historically the event where I become less of an curmudgeon about maintaining old things. |
Politely pinging @vasilmkd, do you have any opinions on this? Things are still a bit new with the |
I wouldn't completely drop it in Cats Effect (and we would set that as a special case), but as a default, I think we should be nudging users towards the future and make JDK 17 the default. |
Yup, this is definitely where things are headed. /cc @valencik In v0.5.0 we'll set |
FWIW, I think catbird probably ought to stay on Java 8 until Twitter supports Java 11 in twitter/util (twitter/util#266). (In my experience, twitter/util does seem to work on Java 11, but I don't have visibility to what's holding them back internally.) |
@bpholt thanks, that's helpful input. Projects such as Cats, Cats Effect, and Http4s will almost certainly want to keep the Java 8 builds as well. So I guess we have to be careful to make sure sbt-typelevel still works on JDK 8, even if we switch the default CI to JDK 17 and set the release flag to Java 8 as proposed here. We can keep thinking about this as we approach sbt-typelevel v0.5.x. |
Another interesting idea: So sbt has a setting for running scalac and forked tests on a different JDK than what sbt itself is running on (h/t @keynmol). val javaHome = settingKey[Option[File]]("Selects the Java installation used for compiling and forking. If None, uses the Java installation running the build.").withRank(ASetting) If we can figure out how to configure this, then it would mean that our tooling can upgrade to newer JDKs (such as sbt plugins as mentioned in #215 (comment)) while we still keep compiling and testing our libraries on the ancient JDK of our choice. Edit: I'm actually not sure if this setting is used for |
Another thing I just encountered: I don't think setting I just had a CI run on Java 8 catch the inadvertent update (because tests failed due to the If tests can continue to run on the old JDK like @armanbilge suggested that feels like solid middle ground. Or maybe there are other ways to catch this earlier? |
Yes that's right. I'm currently leaning towards the It will however take some acrobatics to make this work with the existing Edit: it would also be extremely useful e.g. for feral, where currently everything runs on an Amazon Coretto JDK which is pretty silly. Only the AWS JVM lambdas "need" that, everything else should use Temurin or whatever. |
I still like the |
With regards to java home, you can theoretically use something like this: https://github.com/sourcegraph/scip-java/blob/main/project/JavaToolchainPlugin.scala I should warn you though that when using SBT BSP with Metals, some java compilation state gets corrupted and a lot of weird artifacts appear. The concept replicates Gradle's toolchains, and apart from this weirdness works reasonably well. |
mdoc just dropped Java 8 support. |
I think we no longer support Java 8 for users on the new Sonatype Central host (not the legacy or s01 hosts). |
@armanbilge I think |
If bring jdk configuration to sbt plugins. I have plan to catch all the Here's the sample code: import com.github.sbt.jdk.collection.JDKCollection
javahome := {
// step 1
val JdkVersion = JDKCollection.`v1.8`.`Liberica`.lastest
// ↑ 2 style ↓
val JdkVersion = JDKCollection.`v1.8`.`Liberica`.`v8u432`
// step 2
val jdkAction = (CurrentOS / JdkVersion).value
// step 3
val jdksDirectory = jdkAction.getJDKCollectionDirectory // not use in this code snippet // rootProjectDirectory/target/.jdks/
val currentJDKHome = jdkAction.getHome // rootProjectDirectory/target/.jdks/windows_amd64/Liberica/version_1_8/8u432/
// step 4
jdkAction.downladAndUnzipIfNotExists(currentJDKHome).sync
// step 5
Some(currentJDKHome)
} |
Maybe not tomorrow or even this year, but this stuckfast position will gradually grow more and more uncomfortable. E.g. our sbt-plugins are itching to leave us behind:
FWIW we can probably get along just fine without JDK 8 in CI. But perhaps I haven't heard the horror stories 😆
tlJdkRelease := Some(8)
setting activates all the scalac and javac flags to safely build/release from a newer JDK.tlJdkRelease
setting would actually prevent thoseByteBuffer
-oopsies. In fact fs2 can't use thetlJdkRelease
setting because it blocks access to JDK 9+ APIs!The text was updated successfully, but these errors were encountered: