Fork me on GitHub
#babashka
<
2020-08-18
>
borkdude14:08:14

Building a bb uberjar in milliseconds :)

borkdude@MBP2019 /tmp/proj2 $ time bb -cp src -m my.main-main --uberjar /tmp/foo.jar --verbose
Building uberjar: /tmp/foo.jar
src
src/my/impl.clj
src/my/main_main.clj
src/my/impl2.clj

Generating META-INF/MANIFEST.MF:
Manifest-Version: 1.0
Built-By: depstar
Build-Jdk: 11.0.7
Main-Class: my.main_main
bb -cp src -m my.main-main --uberjar /tmp/foo.jar --verbose  0.01s user 0.01s system 86% cpu 0.030 total
borkdude@MBP2019 /tmp/proj2 $ time bb /tmp/foo.jar 1 2 3
("1" "2" "3")
bb /tmp/foo.jar 1 2 3  0.02s user 0.01s system 93% cpu 0.035 total
borkdude@MBP2019 /tmp/proj2 $ ls -lah /tmp/foo.jar
-rw-r--r--  1 borkdude  staff   1.1K Aug 18 16:55 /tmp/foo.jar

💯 15
🎉 18
hugod16:08:09

could we get deps -Spath into the milliseconds?

borkdude16:08:36

I have tried compiling the tools.jar that is used both by clojure and deps.exe with GraalVM but that didn't work, so for now the answer is no. https://github.com/borkdude/tools-deps-native-experiment

hugod16:08:23

I have it compiling wit graalvm, but am getting a runtime error creating a maven system, so I guess I’m getting options wrong somewhere

borkdude17:08:29

Is it a different error from what I have at the bottom at the repo?

hugod17:08:33

hah, the same

hugod17:08:09

I’m using jgit though, fwiw

borkdude17:08:08

That's interesting, I could not get that to work

borkdude17:08:07

Any public code? I think it's worth documenting in my repo

hugod17:08:37

i’ll put it up when I finish experimenting

borkdude17:08:31

Due to classpath caching it's only slow the first time, but it'd still be cool to not need a JVM for this

hugod17:08:19

right, once the jars are locall it should be reasonably fast

borkdude17:08:08

I mean, clojure -Spath already only takes ms the second time you invoke it with the same deps.edn, etc

borkdude20:08:35

Thanks, merged