babashka-sci-dev

borkdude 2021-10-19T14:51:41.024700Z

@thiagokokada I'd be curious if anything changes for bb/clj-kondo etc with regards to musl in 21.3.0: https://www.graalvm.org/reference-manual/native-image/StaticImages/

kokada 2021-10-19T14:52:34.024900Z

It doesn't seem so

borkdude 2021-10-19T14:53:35.025100Z

They wrote in the 21.3 release notes: • Changed the way the compiler is looked up when creating static, `musl`-based native images to use the `musl` toolchain from https://www.graalvm.org/release-notes/21_3/musl.cc. The `musl` toolchain greatly simplifies the creation of static native images. Using a toolchain also ensures minimum changes will be needed on users’ side to create a dynamically linked `musl` based image. See the https://www.graalvm.org/reference-manual/native-image/StaticImages/.

borkdude 2021-10-19T14:54:03.025300Z

source: https://www.graalvm.org/release-notes/21_3/

kokada 2021-10-19T14:54:33.025600Z

👀

kokada 2021-10-19T15:03:08.025800Z

As far I understood, they changed from calling musl-gcc to x86_64-linux-musl-gcc

kokada 2021-10-19T21:13:18.026100Z

@borkdude I don't think the upgrade should cause too much issues, maybe the only thing we will need to change is to add a symbolic link pointing from musl-gcc to x86_64-musl-gcc

kokada 2021-10-19T21:13:37.026400Z

Another option would be to change to this http://musl.cc toolchain

kokada 2021-10-19T21:14:34.026600Z

BTW:

~/Projects/nixpkgs bump-graalvm
❯ nix path-info ./result -S -h
/nix/store/zprgwm11wl2798whkkifwsxsv45cchg4-babashka-0.6.1	110.9M

~/Projects/nixpkgs bump-graalvm
❯ nix path-info $(nix-whereis bb) -S -h
/nix/store/fay0p3hiiic4kd4fk0xyczl1ff8sjcp1-babashka-0.6.1	120.9M
(The first one is GraalVM 21.3.0, the second one is GraalVM 21.2.0)

kokada 2021-10-19T21:14:59.026800Z

It seems that GraalVM 21.3.0 will reduce the binary quite significantly

borkdude 2021-10-19T21:19:04.027Z

I saw a 10mb reduction in bb with 21.3.0 but when upgrading to jdk 17 it gained 10mb again ;)

borkdude 2021-10-19T21:19:44.027200Z

btw, why is bb so big on nix... this surprises me. in #babashka you can see that the size is 80-90 mb for each os

kokada 2021-10-19T21:37:56.027400Z

This is the whole closure size, including the libraries

kokada 2021-10-19T21:38:05.027600Z

So in this size it also includes glibc

borkdude 2021-10-19T21:38:21.027800Z

that's called a closure in nix?

borkdude 2021-10-19T21:38:37.028Z

ah I see, the entire environment

kokada 2021-10-19T21:38:41.028200Z

Yeah

borkdude 2021-10-19T21:38:45.028400Z

neat

kokada 2021-10-19T21:39:02.028600Z

glibc should be 20MB

kokada 2021-10-19T21:39:07.028800Z

So this explains the difference

kokada 2021-10-19T21:39:38.029Z

(BTW, before the babashka closure was 2GB because we also included the whole GraalVM)

kokada 2021-10-19T21:39:44.029200Z

I recently fixed this on a PR

borkdude 2021-10-19T21:39:50.029400Z

haha wow