Fork me on GitHub
#graalvm
<
2021-08-25
>
jerger_at_dda16:08:13

Hi, at https://gitlab.com/domaindrivenarchitecture/mastodon-bot/-/blob/jvm_based_reimplementation/src/uberjar/clj/mastodon_bot/uberjar.clj#L31 I try ty print a usage message in a cli tool. When running this as java-uberjar the message is printed, when running as graalvm-native it is not. I use latest clojure & tried the flush-tip without success ... any idea or hint?

borkdude16:08:29

Yes, you should use (flush) before exiting

borkdude16:08:00

try (do (print usage) (flush))

ericdallo16:08:02

I had same issue with clojure-lsp building the API, using flush fixed

jerger_at_dda16:08:59

cool works 🙂

jerger_at_dda16:08:33

what's the difference to putting flush at the end of main function?

jerger_at_dda16:08:57

I think that was the way I tried this before ...

borkdude17:08:42

there is no difference, except when that code path isn't hit :)

borkdude17:08:51

e.g. you exit early

☝️ 6
ericdallo18:08:48

and people usually use println which besides the new line calls flush inside it (actually calls prn that calls flush)

ericdallo20:08:35

Finally release sqlite-jdbc which supports graalvm config built-in (no static support yet): https://github.com/xerial/sqlite-jdbc/releases/tag/3.36.0.2 will test with clojure-lsp soon