Skip to content

Commit e97d943

Browse files
authored
Update Scala to 3.8.1 (#249)
* 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: scala/scala3#24109 (comment)
1 parent 9d833d0 commit e97d943

5 files changed

Lines changed: 15 additions & 9 deletions

File tree

.github/workflows/scala.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- os: ubuntu-latest
2222
java: 21
2323
- os: ubuntu-latest
24-
java: 24
24+
java: 25
2525
runs-on: ${{ matrix.os }}
2626

2727
steps:

.scalafix.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ rules = [
55
RedundantSyntax
66
]
77
ExplicitResultTypes.memberVisibility = [Public]
8+
# Needed for support of Scala versions not yet officially supported by Scalafix
9+
ExplicitResultTypes.fetchScala3CompilerArtifactsOnVersionMismatch = true

.scalafmt.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
version = 3.10.3
2-
runner.dialect = scala36
1+
version = 3.10.4
2+
runner.dialect = Scala3Future
33
maxColumn = 100
44
align.preset=none
55
rewrite.trailingCommas.style = always

build.sbt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ThisBuild / semanticdbEnabled := true
2-
lazy val scalaV = "3.7.4"
2+
lazy val scalaV = "3.8.1"
33
ThisBuild / scalaVersion := scalaV
44

55
resolvers +=
@@ -17,15 +17,18 @@ def isDevBuild: Boolean =
1717
sys.env.get("DEV_BUILD").exists(s => s != "0" && s != "false")
1818

1919
lazy val graalOptions = Seq(
20-
// If running on Scala <3.8 and JDK >=24, we need to allow unsafe memory access.
21-
// Otherwise, we get annoying warnings on startup.
22-
// https://github.com/scala/scala3/issues/9013
23-
// Remove this after moving to Scala 3.8
24-
if (scalaV.split('.')(1).toInt < 8) Seq("-J--sun-misc-unsafe-memory-access=allow") else Nil,
2520
// Do a fast build if it's a dev build
2621
// For the release build, optimize for speed and make a build report
2722
if (isDevBuild) Seq("-Ob") else Seq("-O3", "--emit build-report"),
2823
).flatten ++ Seq(
24+
// If using dependencies on Scala <3.8 and JDK >=24, we need to allow unsafe memory access.
25+
// Otherwise, we get annoying warnings on startup.
26+
// https://github.com/scala/scala3/issues/9013
27+
// Remove this after dependency upgrades to Scala 3.8+
28+
// See this thread for an explanation of why this requires also updates in dependencies:
29+
// https://github.com/scala/scala3/pull/24109#issuecomment-3786629196
30+
"-J--sun-misc-unsafe-memory-access=allow",
31+
// Custom Graal features
2932
"--features=eu.neverblink.jelly.cli.graal.ProtobufFeature," +
3033
"eu.neverblink.jelly.cli.graal.JenaInternalsFeature," +
3134
"eu.neverblink.jelly.cli.graal.LargeXmlFeature",

src/main/scala/eu/neverblink/jelly/cli/command/Version.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ object Version extends JellyCommand[VersionOptions]:
3636
|Jelly-JVM $jellyV
3737
|Apache Jena $jenaV
3838
|JVM ${System.getProperty("java.vm.name")} ${System.getProperty("java.vm.version")}
39+
|Scala ${BuildInfo.scalaVersion}
3940
|-------------------------------------------------------------
4041
|""".stripMargin.trim)
4142
// Print feature support info

0 commit comments

Comments
 (0)