Fork me on GitHub

@benzap the Could not locate clojure/core__init.class or clojure/core.clj on classpath error is due to a change they made in the defaults of the first GraalVM release. You now need to specify a flag (for Clojure apps) --initialize-at-build-time

👍 4

This resolved my issue. Thanks a ton


(this used to be a default)


one issue with compiling 1.10 apps is 1.10 depends on a version of clojure.spec that uses locking, and locking doesn’t play well with native-image at the moment, but… you can “patch” calls to it if you really want


I haven't used clojure.spec whatsoever. The original test involved 1.9, i'll try 1.10 and see if it works. Was having issues gettingit working without the fallback


Original tests did not work, so we'll see


@taylor maybe it would be cool to have a lib which bundles the compiled .class file and patches a selection of functions in clojure which uses locking using alter-var-root


this would certainly be convenient, but I think I’d rather it be less convenient for people to clobber clojure.core stuff, or at least I’d feel bad about it 😄


that's why I suggested to hide the alter-var-roots behind functions so people can apply these patches selectively, only when compiling to a binary


so the JVM version of their tools would remain unchanged

👍 4

[clj-native/locking-patch "0.0.1"] + (require '[clj-native.locking-patch :as lp]) (lp/apply-locking-patch!)


or [clj-native/patches ...] with more patches if needed


so the patches can be selectively applied (e.g. only when compiling a binary and not when running your tool with the JVM)


Hello! Does anyone have some experience of using java.time with native-image compilation? I have a case where a non-english time string can't be parsed in the compiled binary. In particular

(let [pattern (DateTimeFormatter/ofPattern "y-M-d[ ][cccc][ccc][ ]H:m" Locale/GERMAN)]
         (LocalDateTime/parse "2018-12-03 Mo 02:17" pattern))
throws java.time.format.DateTimeParseException: Text '2018-12-03 Mo 02:17' could not be parsed at index 11 but works with JVM 8/11. I assume that language support is stripped during compilation. Any way of enabling it again?