This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-02
Channels
- # announcements (6)
- # babashka (21)
- # beginners (38)
- # biff (2)
- # calva (14)
- # cider (5)
- # clerk (4)
- # cljdoc (2)
- # clojure (11)
- # clojure-europe (2)
- # clojure-norway (5)
- # clojure-spec (4)
- # core-typed (8)
- # data-science (5)
- # deps-new (15)
- # events (1)
- # fulcro (2)
- # graalvm (33)
- # holy-lambda (3)
- # hyperfiddle (19)
- # kaocha (1)
- # portal (5)
- # test-check (1)
- # xtdb (9)
- # yamlscript (2)
I'm having trouble with getting a graalvm shared lib working.
I'm pretty close. I'm trying to do things similar to https://github.com/babashka/sci/blob/master/doc/libsci.md which works for me here.
My reproduction can be seen here: https://gist.github.com/ingydotnet/44fe6887cae602ad05ea687fccb3d495
The repo, branch, commit, and reproduction command can be seen here: https://gist.github.com/ingydotnet/44fe6887cae602ad05ea687fccb3d495#file-gistfile1-txt-L4-L18
It's set up to work on linux x64, macos x64 and macos aarch64.
Just run ./test/sh
from the top dir of the clojure
branch of https://github.com/yaml/yamlscript
I need to be afk for about 1 hour but will be back here after that
@U0479UCF48H ++ figured it out. Something to do with data.json
being broken...
Original exception that caused the problem: org.graalvm.compiler.core.common.PermanentBailoutException: Frame states being merged are incompatible: unbalanced monitors - locked objects do not match
Could it be that you are using a clojure version prior to 1.10.3? It had this unbalanced monitor problem which was solved in 1.10.3 and later@U04V15CAJ Finally got the whole thing sorted. @U0479UCF48H got a lot of things fixed including depping on 1.11.1. I finally figured out that I needed to build with some extra reflections: https://github.com/yaml/yamlscript/blob/clojure/libyamlscript/reflection.json See https://clojurians.slack.com/archives/C05HQFMTURF/p1693681789082869
Welp, native-image is failing on my mac m1. https://gist.github.com/ingydotnet/e2b4fab9820ca0b05f9138014bf695aa
@U04V15CAJ ever seen:
com.oracle.svm.core.util.VMError$HostedError: java.lang.RuntimeException: Illegal replacement of symbol table entry
at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:76)
Why don't you first solve those reflection warnings:
Reflection warning, yamlscript/util.clj:10:5 - call to java.lang.Exception ctor can't be resolved.
Reflection warning, fr33m0nk/optional.clj:83:9 - call to method flatMap can't be resolved (target class is unknown).
Reflection warning, yamlscript/parser.clj:46:7 - reference to field getLine on java.lang.Object can't be resolved.
Reflection warning, yamlscript/parser.clj:47:7 - reference to field getColumn on java.lang.Object can't be resolved.
Reflection warning, yamlscript/parser.clj:48:7 - reference to field getIndex on java.lang.Object can't be resolved.
Reflection warning, yamlscript/parser.clj:50:7 - reference to field getLine on java.lang.Object can't be resolved.
Reflection warning, yamlscript/parser.clj:51:7 - reference to field getColumn on java.lang.Object can't be resolved.
Reflection warning, yamlscript/parser.clj:52:7 - reference to field getIndex on java.lang.Object can't be resolved.
Reflection warning, yamlscript/parser.clj:58:29 - reference to field getTag on org.snakeyaml.engine.v2.events.NodeEvent can't be resolved.
Then it's likely that you don't need as many entries in reflect.config eitherI have seen similar errors with leiningen, the solution was to adapt the entry from :aot :all
to :aot [your.main-namespace]
My collaborator tested on his Mac M2 and worked fine
I'll try
the reflection warnings will go away when I switch out snake to another yaml parser.
and aren't currently in the way
the ./clojure/
directory builds a dependency library for the main ./libyamlscript/
yeah, change this to something like: https://github.com/borkdude/jet/blob/939be14ef3443a6ea0a22c387e046b9e415ae4f5/project.clj#L27
ie yamlscript.core
is a dep for libyamlscript.core
ok I'll try that later. thanks!!
Tried https://github.com/yaml/yamlscript/blob/clojure/libyamlscript/project.clj#L25-L26 with same results
The error message is:
The build process encountered an unexpected error:
com.oracle.svm.core.util.VMError$HostedError: java.lang.RuntimeException: Illegal replacement of symbol table entry
which seems to be from svm:
$ ag -ail "Illegal replacement of symbol table entry" /tmp/graalvm
/tmp/graalvm/Contents/Home/lib/svm/builder/objectfile.jar
google couldn't find anything on that message
make sure to clean your target directory before making an uberjar. if this still fails, create an issue with graalvm on github
The error seems to be from here:
I wish the error message included oldEntry.getName()
.
How would I go about recompiling the svm jar to add that?You can build the whole stuff yourself, using these instructions: https://twitter.com/borkdude/status/1621518747155705857
Where do I get the labsjdk-ce-17.0.8... download from?
well on my way to do this I decided to delete ~/.m2
and start as clean as possible, and now the build works
might try again to make sure I know what's up
I actually just moved ~/.m2
to /tmp/
so I guess I could debug (in my copious spare time)
I did it again from scratch and it worked fine. Note, need to do this:
~ $ which java
/usr/bin/java
~ $ echo $JAVA_HOME
/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home
~ $ export PATH=$JAVA_HOME/bin:$PATH
~ $ which java
/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home/bin/java
so maybe that was the culprit.My collaborator tested on his Mac M2 and worked fine