This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-21
Channels
- # announcements (13)
- # babashka (29)
- # beginners (52)
- # calva (95)
- # cider (18)
- # clj-commons (7)
- # cljs-dev (42)
- # clojure (121)
- # clojure-australia (1)
- # clojure-dev (39)
- # clojure-europe (36)
- # clojure-france (4)
- # clojure-greece (1)
- # clojure-italy (20)
- # clojure-nl (3)
- # clojure-portugal (1)
- # clojure-uk (7)
- # clojurescript (47)
- # conjure (2)
- # cursive (9)
- # datalevin (5)
- # datascript (8)
- # datomic (68)
- # defnpodcast (2)
- # deps-new (5)
- # fulcro (18)
- # graalvm (21)
- # gratitude (9)
- # jobs (6)
- # jobs-discuss (17)
- # leiningen (3)
- # lsp (80)
- # lumo (1)
- # malli (9)
- # mount (2)
- # off-topic (16)
- # other-languages (8)
- # podcasts-discuss (19)
- # reitit (5)
- # remote-jobs (5)
- # shadow-cljs (29)
- # sql (5)
- # tools-deps (13)
- # vim (11)
- # xtdb (19)
Maybe this will interested someone: https://gist.github.com/thiagokokada/9803f71bdb82f701b4d2be0112c5a64c This is a Nix Flake with multiple versions for GraalVM, including native-compile, graalpython, TruffleRuby, etc. I succesfully compiled Babashka static using it
Since it is a flake, you can use something like this to get it started:
nix run "git+
This will run native-image
for graalvm11-ce with support for musl (and musl only, glibc builds are broken)
If you use nix run "git+
, this will run native-image
for graalvm11-ce and glibc (no musl support)
If you want to have a quick shell with graalvm11-ce and all binaries, nix develop ""git+
should work
If that works well, maybe @U04V4KLKC could think on making the Github actions use this? as it's pure
I have started porting some of the holy-lambda examples to GraalVM 21.3.0, and I'm seeing that libraries which didn't require additional --initialize-at-build-time
before, now require it.
For instance data.xml
now requires a lot of --initialize-at-build-time
flags.
--initialize-at-build-time=com.sun.org.apache.xerces.internal.util.FeatureState,com.sun.org.apache.xerces.internal.impl.XMLVersionDetector,com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl,com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl,com.sun.org.apache.xerces.internal.util.PropertyState,jdk.xml.internal.JdkXmlUtils,javax.xml.parsers.FactoryFinder,jdk.xml.internal.SecuritySupport,com.sun.org.apache.xerces.internal.impl.XMLEntityScanner,com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDProcessor,com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator,com.sun.org.apache.xerces.internal.impl.XMLEntityManager,com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl,com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl,com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl,javax.xml.datatype.DatatypeFactory
I'm thinking whether Clojure core would accept tiny patches with such configuration or should we keep distributing the configuration via graal-config for core.@UJ1339K2B Are you sure this is in data.xml? I'm using this in bb and I didn't have to do this. Are you sure your code or one of your libs doesn't instantiate any XML things on the top level?
I'm just trying to confirm it in graal-config. The code I tried to compile is using cognitect aws api, but I'm not seeing any usage of data.xml on top level. see: https://github.com/cognitect-labs/aws-api/blob/master/src/cognitect/aws/util.clj
Shouldn't we specify only the classes that the particular library use instead of saying "build all the classes from the namespace xyz"?
Btw found a reflection as well:
(defn -main
[& _args]
(println (xml/parse-str
(xml/emit-str (xml/sexp-as-element
[:foo {:foo-attr "foo value"}
[:bar {:bar-attr "bar value"}
[:baz {} "The baz value"]]])))))
Exception in thread "main" java.lang.IllegalArgumentException: No matching method createXMLStreamReader found taking 1 args for class com.sun.xml.internal.stream.XMLInputFactoryImpl
Optimally yes, but previously you also initialized everything at build time so this is already an improvement ;)
I think we can make a fork of this lib to be honest, to yield much smaller graalvm binaries
Eh. As always you are right. This has something to do with aws api. I will trace the initialization.