This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-31
Channels
- # aleph (37)
- # babashka (23)
- # beginners (46)
- # calva (1)
- # catalyst (12)
- # cider (3)
- # circleci (5)
- # clj-kondo (8)
- # clojure (188)
- # clojure-europe (28)
- # clojure-nl (1)
- # clojure-norway (84)
- # clojure-sweden (2)
- # clojure-uk (1)
- # clojurescript (6)
- # clr (1)
- # cursive (4)
- # datahike (4)
- # datascript (7)
- # datomic (31)
- # deps-new (16)
- # emacs (4)
- # fulcro (4)
- # gratitude (17)
- # hyperfiddle (24)
- # introduce-yourself (4)
- # jobs (5)
- # off-topic (84)
- # pathom (10)
- # polylith (21)
- # portal (6)
- # re-frame (6)
- # reitit (4)
- # releases (1)
- # sci (74)
- # specter (3)
- # tools-build (3)
- # tools-deps (5)
I'm getting this failure trying to bb run libsci:compile
https://gist.github.com/ingydotnet/d6bf87f0d5d180e8d0e1bd8543f1eabb
Am I doing it wrong?
thanks. I am on ubuntu 22.04 using graalvm-community-jdk-17.0.8_linux-x64_bin.tar.gz if that matters...
for graalvm I simply downloaded https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.8/graalvm-community-jdk-17.0.8_linux-x64_bin.tar.gz and untarred it as /tmp/graalvm/
and then ran:
GRAALVM_HOME=/tmp/graalvm bb --debug run libsci:compile
in the sci master root dirthat's my repro. not sure that's the right way.
can you go into your downloaded graal directory and so
$ find . | grep svm.jar
./lib/svm/builder/svm.jar
find . -name svm.jar
finds nothing
the last version that I tested was graalvm CE 22.3 https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-22.3.1
ok, then I think with newer graalvm distros you should maybe include it as a mvn dependency, let me read some docs
yeah, for some reason @U0479UCF48H directed me to use 17.0.8
do you want me to try another graal?
I can try that
yes, I think you'll have better luck with the version that I posted since I only used that one
not sure why @U0479UCF48H suggested the other. I started with most recent
wait. which is newer?
to make matters more complicated, there is also Oracle GraalVM which is different from GraalVM CE
it's not about newer, it's about which version runs on CI with libsci currently, and that is 22.3.1
ok, I'll try that one
You said > but I'll try to see if I can fix it for the new graal version 22.3.1 works and I said 17.0.8 (which seems older) doesn't. is there a third?
> java 19 22.3.1 to be precise I thought java was bundled in there
This link here: https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-22.3.1 And choose JDK19 from the right column
ah cool
Meanwhile I'll try to figure out the issue with the new stuff. In newer versions GraalVM adopts the JVM version number, before they had their independent (22.3.1) version number + a JDK version, so it's matrix of choices there
but 22.3.1 is newer than 17.0.8 right?
what's the new stuff
?
no, 22.3.1 is a GraalVM version number from before they moved to another versioning schema and 17.0.8 is a JDK version number
thanks for the explanation
I suspect they renamed
import com.oracle.svm.core.c.CConst;
to:
import org.graalvm.nativeimage.c.type.CCharPointer;
etc.Finished generating 'libsci' in 1m 58s.
graalvm-ce-java19-linux-amd64-22.3.1.tar.gz
thank you.
Is there any tooling to automate stuff like libsci/src/sci/impl/LibSci.java ?
Hmm, changing the CConst package to import org.graalvm.nativeimage.c.type.CConst;
worked, so it does seem a breaking change on their side, sadly.
alright, merged the change, now it only works with the newest graalvm version, see the latest commit on master. Note that this is a practice we don't like in the clojure ecosystem: they removed a class which is a breaking change
in this case it doesn't really matter since libsci is more a demo than a library, but anway
it's the perfect demo for what I need to do today
so glad it works
@U04V15CAJ fyi I built the the HEAD and tested the python steps from https://github.com/babashka/sci/blob/master/doc/libsci.md#using-libsci-from-python and all works
libsci is almost a perfect recipe for the libyamlscript shared lib system I'm building and binding to various languages starting with python. so glad you did libsci 🙂
Can someone explain the -
in https://github.com/babashka/sci/blob/master/libsci/src/sci/impl/libsci.clj#L7 -evalString
?
is this important https://github.com/babashka/sci/blob/master/project.clj#L20 ?
the libsci:compile
target uses it
why not just 1.11.1?
Not sure what's this
$ /tmp/graalvm/bin/javac -cp target/libyamlscript-0.1.0-standalone.jar:/tmp/graalvm/lib/svm/builder/svm.jar src/libyamlscript/Core.java
src/libyamlscript/Core.java:9: error: cannot find symbol
import com.oracle.svm.core.c.CConst;
^
symbol: class CConst
location: package com.oracle.svm.core.c
src/libyamlscript/Core.java:15: error: cannot find symbol
@CConst CCharPointer s
those 2 jars exist
oh...
I think I copied your old code
sigh. sec
that was it
Trying to understand this line https://github.com/babashka/sci/blob/master/libsci/src/sci/impl/LibSci.java#L12
String result = sci.impl.libsci.evalString(expr);
is sci.impl.libsci
there referring to the clj code or the java code?
I guess clj, as there's no (lowercase) libsci
I have these 2 files modeled after the libsci example: https://github.com/yaml/yamlscript/blob/clojure/libyamlscript/src/libyamlscript/core.clj > https://github.com/babashka/sci/blob/master/libsci/src/sci/impl/libsci.clj https://github.com/yaml/yamlscript/blob/clojure/libyamlscript/src/libyamlscript/Core.java > https://github.com/babashka/sci/blob/master/libsci/src/sci/impl/LibSci.java but when I try to compile the java (after building the clojure uberjar) I get:
★ ~/src/yamlscript/libyamlscript clojure $ lein do clean, uberjar
Created /home/ingy/src/yamlscript/libyamlscript/target/libyamlscript-0.1.0.jar
Created /home/ingy/src/yamlscript/libyamlscript/target/libyamlscript-0.1.0-standalone.jar
★ ~/src/yamlscript/libyamlscript clojure $ /tmp/graalvm/bin/javac -cp target/libyamlscript-0.1.0-standalone.jar:/tmp/graalvm/lib/svm/builder/svm.jar src/libyamlscript/Core.java
src/libyamlscript/Core.java:18: error: cannot find symbol
String json = libyamlscript.core.evalYsToJson(ys);
^
symbol: class core
location: package libyamlscript
1 error
any help would be appreciated★ /tmp/sci master $ git clean -dxf
★ /tmp/sci master $ lein uberjar
Compiling sci.impl.main
Created /tmp/sci/target/sci-0.8.40.jar
Created /tmp/sci/target/sci-0.8.40-standalone.jar
★ /tmp/sci master $ unzip -l target/sci-0.8.40.jar | grep libsci
★ /tmp/sci master $ git clean -dxf
Removing target/
★ /tmp/sci master $ lein with-profiles +libsci,+native-image uberjar
Compiling sci.impl.main
Compiling sci.impl.libsci
Created /tmp/sci/target/sci-0.8.40.jar
Created /tmp/sci/target/sci-0.8.40-standalone.jar
★ /tmp/sci master $ unzip -l target/sci-0.8.40.jar | grep libsci
1349 2023-08-31 16:39 sci/impl/libsci$fn__5658.class
2176 2023-08-31 16:39 sci/impl/libsci$loading__6737__auto____4946.class
2599 2023-08-31 16:39 sci/impl/libsci__init.class
1465 2023-08-31 16:39 sci/impl/libsci$_evalString.class
1936 2023-08-31 16:39 sci/impl/libsci$_evalString$fn__5660.class
2243 2023-08-31 16:39 sci/impl/libsci.class
560 2023-08-31 07:37 sci/impl/libsci.clj
getting closerI need :aot [yamlscript.core]