Fork me on GitHub
#babashka-sci-dev
<
2021-10-19
>
borkdude14:10:41

@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/

kokada14:10:34

It doesn't seem so

borkdude14:10:35

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/.

kokada15:10:08

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

kokada21:10:18

@U04V15CAJ 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

kokada21:10:37

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

kokada21:10:34

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)

kokada21:10:59

It seems that GraalVM 21.3.0 will reduce the binary quite significantly

borkdude21:10:04

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

borkdude21:10:44

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

kokada21:10:56

This is the whole closure size, including the libraries

kokada21:10:05

So in this size it also includes glibc

borkdude21:10:21

that's called a closure in nix?

borkdude21:10:37

ah I see, the entire environment

kokada21:10:02

glibc should be 20MB

kokada21:10:07

So this explains the difference

kokada21:10:38

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

kokada21:10:44

I recently fixed this on a PR