Support GraalVM native image on Scala 3
See original GitHub issueTo build a cats-effect 3 app with Scala 3 and GraalVM native image, one currently has to set some configuration options, otherwise the build falls back to a version that requires a JDK.
This is what the native-image agent generated for me:
[
{
"name":"cats.effect.unsafe.IORuntimeCompanionPlatform",
"fields":[{"name":"0bitmap$1", "allowUnsafeAccess":true}]
},
{
"name":"cats.effect.unsafe.WorkStealingThreadPool",
"fields":[{"name":"0bitmap$1", "allowUnsafeAccess":true}]
},
{
"name":"java.lang.invoke.VarHandle"
},
{
"name":"sun.misc.Unsafe",
"allDeclaredFields":true
}
]
(passed with -H:ReflectionConfigurationFiles
)
Maybe we can include some version of this in the jar itself, so users don’t need to bother with these options: https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/
Here’s a sample app built with this config: https://github.com/kubukoz/graalvm-native-ce3/ (note that the options aren’t necessary when building with Scala 2.13.6)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Fails to build native image for Scala 3 application which uses ...
Describe the issue Native image fails for Scala 3 application with kind-projector plugin enabled due to being unable to locate needed ...
Read more >GraalVM native-image with Scala 3 reflection hell - Reddit
Although I had relatively good experiences with GraalVM Native-Image and Scala 2.13, I am now having trouble porting my applications to Scala 3....
Read more >Native Image - GraalVM
Write efficient, more secure, and instantly scalable cloud native Java applications ... Native Image is supported by all the leading microservice frameworks ...
Read more >GraalVM Native Image · Cats Effect - Typelevel
Luckily, GraalVM Native Image has full support for both Proxy and POSIX signals. Cats Effect jars contain extra metadata that makes building native...
Read more >compiling the client with GraalVM Native Image - YouTube
Episode 3 of the series! This one is focused on adding support for generating a GraalVM native image for our client.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Maybe some of this could be attached to the dotty runtime? 😄
Agreed. I think this works fine.