It seems like GraalVM works on compose desktop, bu...
# compose-desktop
c
It seems like GraalVM works on compose desktop, but the gradle plugin doesn't work with the multiplatform plugin so all the configuration has to be done manually 馃ゲ
It also runs faster on the computer I used to test. I hadn't even turned on optimizations
r
@讗诇讬讛讜 讛讚住 depends on the scenario I think. For something that's always running, it can be nontrivial. Customers will complain about high background memory usage for sure
u
I understand, and why wouldn't it be possible to use kotlin native instead of graalvm? I guess it requires a lot more work
c
Desktop compose uses swing which is Java
I figured out how to use the graalvm gradle build tools. Separated out the desktop entry point into its own gradle submodule and used kotlin jvm plugin. Everything works now...I just need to troubleshoot the weirdness with a missing swing class and segfaults on exit. Other than that, the app runs great.
r
Oh very interesting. I was under the impression that Swing couldn't be built with GraalVM.
c
It can. You just need to run the app with the native image agent attached and collect reflection metadata first. Then use that to build the image
u
c
The segfaults on exit went away btw, but the missing swing class error is still there. It doesn't seem to affect anything though
I looked at the compose-graal-hello while doing this exercise. It uses a different window manager though.
s
GraalVM support for AWT is limited to linux and windows. No mac mac support - https://github.com/oracle/graal/issues/4124
310 Views