From 8ab6696d76850f07c1a88ff2a21d83a750fcc95d Mon Sep 17 00:00:00 2001 From: Ostrzyciel Date: Fri, 23 Jan 2026 09:54:53 +0100 Subject: [PATCH 1/3] Update Scala to 3.8.1 Also update the JVM version used to run tests to 25. I was hoping we will be able to get rid of `-J--sun-misc-unsafe-memory-access=allow` but unfortunately nope, that piece of code is compiled by scalac and injected into dependency JARs... so we will have to wait for the next Scala LTS. See: https://github.com/scala/scala3/pull/24109#issuecomment-3786629196 --- .github/workflows/scala.yml | 2 +- .scalafix.conf | 2 ++ .scalafmt.conf | 2 +- build.sbt | 16 ++++++++++------ .../neverblink/jelly/cli/command/Version.scala | 1 + 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index 3c3301b..d1e8fa7 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -21,7 +21,7 @@ jobs: - os: ubuntu-latest java: 21 - os: ubuntu-latest - java: 24 + java: 25 runs-on: ${{ matrix.os }} steps: diff --git a/.scalafix.conf b/.scalafix.conf index 7b1e65a..07ce3ba 100644 --- a/.scalafix.conf +++ b/.scalafix.conf @@ -5,3 +5,5 @@ rules = [ RedundantSyntax ] ExplicitResultTypes.memberVisibility = [Public] +# Needed for support of Scala versions not yet officially supported by Scalafix +ExplicitResultTypes.fetchScala3CompilerArtifactsOnVersionMismatch = true diff --git a/.scalafmt.conf b/.scalafmt.conf index c5e69d1..12087b0 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,5 +1,5 @@ version = 3.10.3 -runner.dialect = scala36 +runner.dialect = Scala3Future maxColumn = 100 align.preset=none rewrite.trailingCommas.style = always diff --git a/build.sbt b/build.sbt index 0064977..3274e47 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,5 @@ ThisBuild / semanticdbEnabled := true -lazy val scalaV = "3.7.4" +lazy val scalaV = "3.8.1" ThisBuild / scalaVersion := scalaV resolvers += @@ -17,15 +17,18 @@ def isDevBuild: Boolean = sys.env.get("DEV_BUILD").exists(s => s != "0" && s != "false") lazy val graalOptions = Seq( - // If running on Scala <3.8 and JDK >=24, we need to allow unsafe memory access. - // Otherwise, we get annoying warnings on startup. - // https://github.com/scala/scala3/issues/9013 - // Remove this after moving to Scala 3.8 - if (scalaV.split('.')(1).toInt < 8) Seq("-J--sun-misc-unsafe-memory-access=allow") else Nil, // Do a fast build if it's a dev build // For the release build, optimize for speed and make a build report if (isDevBuild) Seq("-Ob") else Seq("-O3", "--emit build-report"), ).flatten ++ Seq( + // If using dependencies on Scala <3.8 and JDK >=24, we need to allow unsafe memory access. + // Otherwise, we get annoying warnings on startup. + // https://github.com/scala/scala3/issues/9013 + // Remove this after dependency upgrades to Scala 3.8+ + // See this thread for an explanation of why this requires also updates in dependencies: + // https://github.com/scala/scala3/pull/24109#issuecomment-3786629196 + "-J--sun-misc-unsafe-memory-access=allow", + // Custom Graal features "--features=eu.neverblink.jelly.cli.graal.ProtobufFeature," + "eu.neverblink.jelly.cli.graal.JenaInternalsFeature," + "eu.neverblink.jelly.cli.graal.LargeXmlFeature", @@ -103,4 +106,5 @@ lazy val root = (project in file(".")) // Do a fast build if it's a dev build // For the release build, optimize for speed and make a build report graalVMNativeImageOptions := graalOptions, + graalVMNativeImageCommand := "/opt/graalvm_2025_09/bin/native-image", ) diff --git a/src/main/scala/eu/neverblink/jelly/cli/command/Version.scala b/src/main/scala/eu/neverblink/jelly/cli/command/Version.scala index 66c2e14..bbe129c 100644 --- a/src/main/scala/eu/neverblink/jelly/cli/command/Version.scala +++ b/src/main/scala/eu/neverblink/jelly/cli/command/Version.scala @@ -36,6 +36,7 @@ object Version extends JellyCommand[VersionOptions]: |Jelly-JVM $jellyV |Apache Jena $jenaV |JVM ${System.getProperty("java.vm.name")} ${System.getProperty("java.vm.version")} + |Scala ${BuildInfo.scalaVersion} |------------------------------------------------------------- |""".stripMargin.trim) // Print feature support info From 83d9b03ed781b7dc708dfec1220f049271aecfc1 Mon Sep 17 00:00:00 2001 From: Ostrzyciel Date: Fri, 23 Jan 2026 09:56:09 +0100 Subject: [PATCH 2/3] fix --- build.sbt | 1 - 1 file changed, 1 deletion(-) diff --git a/build.sbt b/build.sbt index 3274e47..49587e5 100644 --- a/build.sbt +++ b/build.sbt @@ -106,5 +106,4 @@ lazy val root = (project in file(".")) // Do a fast build if it's a dev build // For the release build, optimize for speed and make a build report graalVMNativeImageOptions := graalOptions, - graalVMNativeImageCommand := "/opt/graalvm_2025_09/bin/native-image", ) From 7cb6c60c3619dfce9f7eb0ef3469f38bed3faf81 Mon Sep 17 00:00:00 2001 From: Ostrzyciel Date: Fri, 23 Jan 2026 09:57:01 +0100 Subject: [PATCH 3/3] fix2 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 12087b0..2b00356 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.10.3 +version = 3.10.4 runner.dialect = Scala3Future maxColumn = 100 align.preset=none