nextjournal / markdown

A cross-platform clojure/script parser for Markdown
ISC License
46 stars 6 forks source link

Bump Graal js language to support Java 22 #24

Closed zampino closed 1 week ago

zampino commented 6 months ago

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

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 commented 6 months ago

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

AndreaCrotti commented 3 months ago

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.

zampino commented 3 months ago

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.

AndreaCrotti commented 3 months ago

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

zampino commented 1 week ago

Obsolete since #28.