Anyone got postal working with graalvm?
$ rlwrap ./bb
Babashka v0.2.2-SNAPSHOT REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.
user=> (require '[postal.core :as p])
nil
user=> (p/send-message {} {:from "<mailto:michielborkent@gmail.com|michielborkent@gmail.com>" :to "<mailto:michielborkent@gmail.com|michielborkent@gmail.com>" :body "hello"})
java.lang.NoClassDefFoundError [at <repl>:2:1]
I've already added [javax.activation/javax.activation-api "1.2.0"] but maybe I need some reflection configmaybe @alekcz360 with https://github.com/alekcz/pcp/blob/master/src/pcp/includes.clj#L13 I see it’s there, didn’t test it
@borkdude @jeroenvandijk it's not working. I ended up have the core engine on JVM and the developer tool with Graalvm
I did try. But ended in java mail and that was a nope.
But that was shared ago. I knew next to nothing about Graalvm then
I'm getting:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type text/plain; charset=utf-8 [at <repl>:2:1]
Looking at this page: https://stackoverflow.com/questions/21856211/javax-activation-unsupporteddatatypeexception-no-object-dch-for-mime-type-multi
I have added:
'-H:IncludeResources=.*mailcap\.default*'
'-H:IncludeResources=.*mimetypes\.default.*'
but it doesn't seem to helpoh a typo maybe
btw I haven't seen these resources been logged for a while with
"-H:Log=registerResource:"
Maybe this Quarkus extension could be wrapped in some Clojure code: https://github.com/quarkusio/quarkus/tree/master/extensions/mailer But that wouldn't be the same as postal
ok, I'll leave it at this for now, summary in https://github.com/borkdude/babashka/issues/599
does the -Dclojure.compiler.direct-linking=true
actually do anything with GraalVM 20.2.0? I've not noticed any difference in my own projects
It should have benefit on binary size and runtime speed at least, but in some cases also memory consumption during compilation
Gotcha. I double checked with a (medium-sized) cli app at my company and didn't notice a significant difference except for maybe a 1-2% runtime speed improvement. I also tried recompiling babashka: the compilation w/out flags used a bit less RAM, and the non-flag binary was 1.5MB smaller (69.MB vs 70.8MB). Not sure if there's a performance difference between the two babashka builds
Maybe there's a difference in very high-performance scenarios?
See one case: https://github.com/borkdude/sci/issues/414#issuecomment-695337600 Also read this: https://epiccastle.io/blog/faster-graalvm-clojure-compilation-times/
I've seen the epiccastle post, but wasn't aware of that issue
it's not graalvm related per se, just performance related in general
the sci issue
Also tried compiling babashka with & without it and the compilation time was faster when I removed it
When I say "removed it" I mean I removed it in both project.clj and the -J-D
flag in the call to native-image that compiles the binary