This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (4)
- # asami (11)
- # babashka (1)
- # beginners (70)
- # bitcoin (2)
- # calva (68)
- # cider (311)
- # clara (1)
- # clj-kondo (58)
- # cljsrn (18)
- # clojure (37)
- # clojure-australia (1)
- # clojure-europe (22)
- # clojure-poland (6)
- # clojure-serbia (2)
- # clojure-spec (9)
- # clojurescript (11)
- # conjure (4)
- # cursive (16)
- # data-oriented-programming (21)
- # datahike (1)
- # emacs (10)
- # events (1)
- # fulcro (9)
- # girouette (2)
- # graalvm (52)
- # graphql (2)
- # jobs-discuss (5)
- # lsp (8)
- # malli (8)
- # off-topic (17)
- # other-languages (46)
- # pathom (17)
- # portal (2)
- # shadow-cljs (11)
- # slack-help (2)
- # sql (47)
- # tools-deps (14)
- # tree-sitter (1)
- # xtdb (6)
@borkdude: just watching your Graal video, nice! If you're looking for ideas/requests for videos - I would love one on development for Clojure with Docker. Personally I've never really grokked Docker and then when you add mounting your src and connecting through the REPL it feels complex - though the idea of a repeatable / shareable dev set-up is cool.
@slgeorge That's not my favorite thing to do either. I only run services in Docker, not the main app I'm developing usually
And a good review of our old hello world scripts! I think I’ll update with some of your comments. I can also link in your video.
One thing I also tend to do by default now is use depstar to build an uberjar first. This prevented me having some weird "too long classpath" problems on Windows, so I kinda do it by default now
was thinking at one point of rewriting script in bb so that it’d work on windows but decided against it. we can point to examples in the wild.
Has anyone gotten cljfmt to run as a native image? When I run lein native-image, I get an exception:
(I am a beginner at clojure so let me know if there is a better place to ask.)
Caused by: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.ClassLoader.defineClass(String, byte, int, int) is reachable
@johan1a Have you maybe watched my video? https://youtu.be/G9Xp2zlEmos
It would be interesting to see which part of cljfmt triggers that though, afaik it doesn't need compilation anywhere, but there could be some runtime
require or something lingering somewhere
Clojure-lsp uses cljfmt via JVM and is compiled with graalvm, maybe the graalvm config should be similar? https://github.com/clojure-lsp/clojure-lsp/tree/master/graalvm
Ah I see the cljfmt project already has a graalvm config: https://github.com/weavejester/cljfmt/blob/master/cljfmt/project.clj
@borkdude shouldn't cljfmt add the reflect config to the classpath/META-INF folder? then it would work for projects that use?
Thanks, it worked when I added the --report-unsupported-elements-at-runtime. I will watch the video!
@ericdallo Will native-image gather all configs?
yes, I saw it somewhere, if the lib add its graalvm config to a specific folder,
native-image will check that automatically
I don't see the
--report-unsupported-elements-at-runtime flag in the build of cljfmt itself, so I still wonder what triggered it @johan1a. Can you share your entire in a gist?
ok, weird, I don't see anything suspicious about cljfmt there. thanks for sharing
Yeah, that'd be perfect for clj-kondo/lsp4j/slite/datalevin and etc for example, then other libs would need to just take care of its lib graalvm configuration, not copy other libs reflect/jni etc content
huh… looks like current GraalVM install instruction https://www.graalvm.org/docs/getting-started/linux/.
@lee That's for general JVM usage. Check here: https://www.graalvm.org/reference-manual/native-image/
I also saw they used this in some of their latest streaming videos on twitch. But regardless, I think it's a saner convention
since GraalVM has more stuff than only invoking
native-image, like the
gu installer for installing
native-image in the first place
I use SDKman and it only sets JAVA_HOME, but I’ll stick with GRAALVM_HOME for clj-graal-docs hello world.
and it's easier to set
GRAALVM_HOME and place
GRAALVM_HOME/bin on the path
I end up setting GRAALVM_HOME to JAVA_HOME for scripts that require it. But either way is good with me.
Really good video @borkdude, If I had that when compiling clojure-lsp... 😄 I bet it will help new users to compile with graalvm their clojure apps
I’ve updated our https://github.com/lread/clj-graal-docs/blob/master/doc/hello-world.md to address some review comments from @borkdude’s video. Also, of course, included a link to the vid. This means I watched your video TWICE @borkdude! It was even better the 2nd time!