This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-07
Channels
- # announcements (10)
- # architecture (25)
- # babashka (5)
- # beginners (95)
- # calva (1)
- # cider (3)
- # clerk (16)
- # clj-on-windows (41)
- # clojure (64)
- # clojure-europe (7)
- # clojurescript (9)
- # deps-new (2)
- # graalvm (25)
- # honeysql (3)
- # hyperfiddle (19)
- # malli (1)
- # meander (5)
- # music (1)
- # nbb (1)
- # off-topic (54)
- # rdf (10)
- # releases (2)
- # shadow-cljs (12)
- # tools-deps (41)
Hi, I'm following the instructions for Libsci https://github.com/babashka/sci/blob/master/doc/libsci.md "Currently 20.3.0 Java 11 must be used." The instructions state that 20.3.0 is the GraalVM version to install, I'm using a M1 ARM and there doesn't appear to be a ARM download available for this version of GraalVM Am I understanding the instructions correctly? If so is there any solution for me using 20.3.0 with an M1. The link below says there is a solution using Rosetta 2, is that what I should look at doing? https://github.com/oracle/graal/issues/2666 Thanks
This version number is probably too old.best to check what is used in CI in GitHub Actions
I see, then i'll use a recent version. Just thought there might be a reason for saying 20.3.0 exactly in the instructions. Thanks for the help.
I think it was to force people to use the newest version back then but the text was never updated
Makes sense. Well fwiw I followed the rest of the instructions and got the example with from_cpp.cpp to work so I can confirm the latest GraalVM works fine for M1 Arm. There was one part of the instructions that might be useful to update/simplify. Since the compile-native fn in libsci_tasks.clj does this part of the instructions automatically now.
$GRAALVM_HOME/bin/native-image \
-jar $SCI_JAR \
-cp libsci/src \
-H:Name=libsci \
--shared \
...
Instead of using the command line instructions shown. I called (compile-native) at the end of a copy of libsci_tasks.clj that was moved to the root of the sci project folder. Running 'bb libsci_tasks.clj' generated all the files automatically in the right directories.
If it's helpful to you I can make this small change to libsci.md and submit a PR.I'm not 100% sure what you mean but maybe just submit a PR and then I'll understand :)
fyi - https://github.com/babashka/sci/pull/908 here's the PR I hope I did a better job of explaining there
@U05NDSC6VPU I think we have a misunderstanding. You can just run bb libsci:compile
to compile the native binary
The docs are already saying:
Convenient `babashka` tasks are provided to compile `libsci` and most
of the examples mentioned here, see `bb tasks` for the full list.
I see, I missed that part of the instructions somehow. Well that makes my PR redundant. Sorry for the confusion.
Not sure where to ask about this but I started using zprint for the yamlscript compiler to nicely format clojure code.
When I run lein test
it gives me a ton of warnings with *warn-on-reflection*
Auto-boxing loop arg: column
zprint.cljc:5687 recur arg for primitive local: index is not matching primitive, had: Object, needed: long
Auto-boxing loop arg: index
zprint.cljc:7753 recur arg for primitive local: newline_count is not matching primitive, had: Object, needed: long
Auto-boxing loop arg: newline-count
Reflection warning, zprint/zprint.cljc:8181:27 - reference to field toString can't be resolved.
Asking here as I've been told that reflections are bad for graalvm native-image...Boxing doesn’t hurt GraalVM native image. The warnings you’re seeing here are because of warn-on-boxed. Only important if you want better perf, not important for getting it to work
Well there is that
Reflection warning, zprint/zprint.cljc:8181:27 - reference to field toString can't be resolved.
line above...Also kind of weird that warn-on-boxed
is enabled. I only set *warn-on-reflection*
(in project.clj)
Perhaps warn-on-boxed is set inside of the project itself. The toString thing can be fixed in zprint
@UE21H2HHD told me the zprint author doesn't hang out here. I'll file an issue.