cats-effect
cats-effect copied to clipboard
Error Building Native Image on 3.3.13
Building results in the following error.
Error: Error parsing dynamic proxy configuration in jar:file:/Users/chrisdavenport/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-effect_2.13/3.3.13/cats-effect_2.13-3.3.13.jar!/META-INF/native-image/org.typelevel/cats-effect/sun-misc-signal-proxy-config.json:
second level of document must be a lists of objects
Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option DynamicProxyConfigurationResources.
Chris didn't include it here but this is the config he pasted on Discord:
nativeImageJvm := "graalvm-ce-java11",
nativeImageVersion := "21.1.0",
nativeImageJvmIndex := "jabba"
Ok, confirmed to work in 3.3.12. So it's a regression due to https://github.com/typelevel/cats-effect/pull/3053. Probably we mucked up the format. Annoying but we probably want to build an image in CI to avoid these sorts of errors...
I rolled back to 3.3.12 and it did not hit this issue, meaning the likely culprit is https://github.com/typelevel/cats-effect/pull/3053
Damn it, it's literally written as in the website. 😡
I was able to build a native image using cats-effect
3.3.14
using GraalVM 22.1.0. The config is correct. It could be the case that it only works with latest GraalVM. Sorry about that. I guess #3053 should be reverted.
Can GraalVM 22.1.0 build a native image using 3.3.12? I would rather bias in favor of more recent versions.
There is another issue with native image. Reported in: https://github.com/oracle/graal/issues/4530 https://github.com/lampepfl/dotty/issues/15091
This is fixed in Scala 3.2.0-RC1, but I have to rebuild CE libraries locally to have it working.
At least it hints, that if you want to test native image - you should test both Scala 2 and Scala 3 separately, which looks really unfortunate.
Should I open a separate issue to track this?
@arixmkii thanks for chiming in, see https://github.com/typelevel/cats-effect/issues/3030#issuecomment-1182798741.
I guess we can close this.
- https://github.com/typelevel/cats-effect/pull/3097.