markdown icon indicating copy to clipboard operation
markdown copied to clipboard

Bump Graal js language to support Java 22

Open zampino opened this issue 1 year ago • 4 comments

Specifically with truffle api library dropping sun.misc.Unsafe which is no longer present in Java 22:

  • https://github.com/oracle/graal/pull/7510
  • https://bugs.openjdk.org/browse/JDK-8316160

Closes #23.

🚧 This will probably not be merged, as we'd lose support of Java 11. We're trying to drop Graal polyglot (#25) for the clj side of things.

zampino avatar Apr 02 '24 14:04 zampino

With the latest graal truffle we get support for Java 22, but we need at least Java 17, CI is on Java 11 and throws

Syntax error (UnsupportedClassVersionError) compiling at (nextjournal/markdown.clj:1:1). org/graalvm/polyglot/Context has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

zampino avatar Apr 02 '24 14:04 zampino

Weirdly enough I get this error when I run tests, but my colleagues don't with the same version of JDK (temurin11). I tried multiple versions but always the same, and even more weirdly if I start the repl and run the tests in the repl it all works fine.

But more importantly, why does this library even depend on graalvm? Is that necessary for just using it for Clojure? I tried to exclude all the JS dependencies since I don't need it for clojurescript but it blows up if I do that.

AndreaCrotti avatar Jun 10 '24 14:06 AndreaCrotti

why does this library even depend on graalvm? Is that necessary for just using it for Clojure?

Yes, it is. Strictly speaking, we're not depending on GraalVM, but we're using the graal polyglot library to call the markdown-it tokenizer on the JVM (GraalVM or any else), this guarantees the same behaviour on both clj/s sides. We're probably dropping this approach in #25.

zampino avatar Jun 11 '24 15:06 zampino

Ah nice good to know it might not be needed anymore soon, thanks

AndreaCrotti avatar Jun 11 '24 16:06 AndreaCrotti

Obsolete since #28.

zampino avatar Sep 24 '24 16:09 zampino