Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Gedochao
Copy link
Contributor

@Gedochao Gedochao commented Oct 29, 2025

Closes #3922

What and why?

These modules have been used historically to handle issues with sun.misc.Unsafe/ lazy val implementations in Scala 3.0-3.2.
This is AFAIK no longer needed in modern Scala versions.
As pre-3.3 Scala is no longer supported, I am dropping those from the repository.
We still keep the dependency on old versions of those modules for the time being, just so that one could build native images with Scala 3.0-3.2, although that code path is deprecated for future removal.

Changes

  • when generating a native image on Graal with Scala 3.0-3.2, the user will now get a warning
    [warning] building native images with Scala 3 older than 3.3.0 is deprecated.
    [warning] support will be dropped in a future Scala CLI version.
    [warning] it is advised to upgrade to a more recent Scala version
    
  • removed 3 modules from the project, their usage is frozen at the last published version (1.9.1)
    • scala3-runtime
    • scala3-graal
    • scala3-graal-processor

Potential follow-ups

Were we to ever bump the internal JDK to 24 or higher, we'd need to remove this completely; for now, seems rather harmless to leave this as status quo.
We can consider removing it when we bump internal Scala to 3.9 - as far as I see it, Scala 3.0-3.2 is EOL, anyways. So perhaps sometime in 2026.

Further reading

@Gedochao Gedochao force-pushed the maintenance/drop-legacy-scala3-bytecode-processing branch from f36e133 to 35d1997 Compare October 30, 2025 09:33
@Gedochao Gedochao force-pushed the maintenance/drop-legacy-scala3-bytecode-processing branch from 35d1997 to 090d34a Compare October 30, 2025 10:24
@lbialy
Copy link
Contributor

lbialy commented Oct 30, 2025

If and when lazyvalgrade is done, you might want to consider introducing it instead as with GraalVM native-image situation is way different than with jvm itself - there's literally no reason not to build binaries with a modern GraalVM instead of GraalVM for jdk 1.8 so it would mean we would replace broken lazy vals with the ones from Scala 3.8 before pushing the bytecode into the native-image.

@Gedochao Gedochao marked this pull request as ready for review October 30, 2025 14:13
@Gedochao Gedochao requested review from tgodzik and zielinsky October 30, 2025 14:13
@Gedochao Gedochao merged commit 1813d62 into VirtusLab:main Oct 30, 2025
115 of 159 checks passed
@Gedochao Gedochao deleted the maintenance/drop-legacy-scala3-bytecode-processing branch October 30, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle sun.misc.Unsafe in scala3-runtime

3 participants