cats-effect icon indicating copy to clipboard operation
cats-effect copied to clipboard

Error Building Native Image on 3.3.13

Open ChristopherDavenport opened this issue 2 years ago • 8 comments

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.

ChristopherDavenport avatar Jul 12 '22 14:07 ChristopherDavenport

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"

armanbilge avatar Jul 12 '22 14:07 armanbilge

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...

armanbilge avatar Jul 12 '22 14:07 armanbilge

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

ChristopherDavenport avatar Jul 12 '22 14:07 ChristopherDavenport

Damn it, it's literally written as in the website. 😡

vasilmkd avatar Jul 12 '22 16:07 vasilmkd

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.

vasilmkd avatar Jul 12 '22 23:07 vasilmkd

Can GraalVM 22.1.0 build a native image using 3.3.12? I would rather bias in favor of more recent versions.

djspiewak avatar Jul 13 '22 03:07 djspiewak

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 avatar Jul 13 '22 13:07 arixmkii

@arixmkii thanks for chiming in, see https://github.com/typelevel/cats-effect/issues/3030#issuecomment-1182798741.

armanbilge avatar Jul 13 '22 13:07 armanbilge

I guess we can close this.

  • https://github.com/typelevel/cats-effect/pull/3097.

armanbilge avatar Nov 06 '22 02:11 armanbilge