This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-09
Channels
- # announcements (47)
- # asami (43)
- # babashka (37)
- # beginners (119)
- # bitcoin (1)
- # calva (5)
- # circleci (5)
- # clj-kondo (36)
- # cljs-dev (5)
- # cljsrn (1)
- # clojure (92)
- # clojure-australia (2)
- # clojure-bay-area (2)
- # clojure-europe (121)
- # clojure-italy (7)
- # clojure-japan (1)
- # clojure-nl (4)
- # clojure-serbia (2)
- # clojure-uk (66)
- # clojuredesign-podcast (2)
- # clojurescript (19)
- # conjure (2)
- # cursive (13)
- # data-oriented-programming (2)
- # datomic (53)
- # defnpodcast (7)
- # depstar (33)
- # events (1)
- # fulcro (21)
- # graalvm (47)
- # jobs (1)
- # kaocha (1)
- # lambdaisland (1)
- # luminus (2)
- # malli (14)
- # membrane (16)
- # off-topic (45)
- # polylith (2)
- # re-frame (11)
- # reitit (7)
- # releases (1)
- # reveal (15)
- # rewrite-clj (123)
- # shadow-cljs (7)
- # sql (21)
- # startup-in-a-month (3)
- # tools-deps (25)
- # vim (2)
i have a question, it may be obvious, but why all the native image build guides for Clojure recommend --initialize-at-build-time
?
yes, i did, and it failed. clojure.lang.PersistentList$EmptyList etc. will be initialized and it is not allowed.
Afaik build time = better for perf, but sometimes you need to delay this until runtime because of side effects like starting threads
ok, thanks. the reason i asked is because some guys in graalvm channel seems to think that initialize at build time should be exception rather than the norm.
the problem i am trying to solve is to build native image on windows, it fails with “other” has different root
@huahaiy You can override this for some classes with --initialize-at-runtime=foo.bar.Clazz
i don’t have a windows machine, so i have to use github action, they put the files on different disk, hence the error i guess
i can check in the workflow yml file that i used for testing windows build on github actions, would that be sufficient?
@huahaiy Are you absolutely sure it's not related to the reflector issue? Fatal error:java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: 'other' has different root # Static libraries: at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
@huahaiy if you need any example also, you can check clojure-lsp as well: https://github.com/clojure-lsp/clojure-lsp/blob/master/.github/workflows/release.yml#L47-L266
A couple of things GitHub Actions have that are kinda nice if you need/want them: macOS in the free tier and more RAM.
i guess it is because i build datalevin twice, once for the command line tool, once for the native tests
I’m currently on GitHub Actions for rewrite-clj v1 where I do some GraalVM native-image testing.
thanks for the example. I will see if it helps. one thing that might be different is that i do need to build C code
rewrite-clj / clj-kondo / clojure-lsp aren't such heavy tools, but as soon as you require a little bit more, Github actions really shows that it's just built for "actions" on your source code, rather than building stuff with good performance. Probably good enough for JavaScript projects