This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-05
Channels
- # adventofcode (89)
- # announcements (9)
- # babashka (11)
- # beginners (8)
- # biff (5)
- # calva (4)
- # cherry (121)
- # clara (15)
- # clerk (16)
- # clj-kondo (20)
- # clj-otel (2)
- # cljdoc (20)
- # clojure (84)
- # clojure-austin (1)
- # clojure-bay-area (3)
- # clojure-berlin (1)
- # clojure-czech (2)
- # clojure-europe (59)
- # clojure-nl (1)
- # clojure-norway (12)
- # clojure-poland (1)
- # clojure-uk (15)
- # cursive (16)
- # datomic (46)
- # events (3)
- # fulcro (85)
- # graalvm (20)
- # hyperfiddle (11)
- # improve-getting-started (1)
- # lsp (7)
- # off-topic (48)
- # overtone (8)
- # podcasts-discuss (4)
- # re-frame (31)
- # releases (1)
- # ring (12)
- # sci (13)
- # shadow-cljs (8)
- # specter (3)
- # squint (26)
- # xtdb (5)
- # yamlscript (6)
I made a github release of YAMLScript's ys
binary https://github.com/yaml/yamlscript/releases/tag/0.1.20 and wrote about it here: https://yamlscript.org/posts/advent-2023/dec-05/
One of the readers had a problem running it:
$ ys-install/bin/ys --version
ys-install/bin/ys: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by ys-install/bin/ys)
ys-install/bin/ys: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ys-install/bin/ys)
and said:
> ldd --version
> ldd (GNU libc) 2.31
> opensuse leap is not always current on libs and kernels
> ugh, that glibc I have on this machine is old, and this is the latest stable release of opensuse
He can build ys
(`make build`) on that machine fine.If you build a dynamic binary it will depend on the glibc on the machine you build it on
For this reason I choose to build it on an image which has a low as possible glibc such that most users will have it
Thanks! What are the downsides of static?
I see more positives to static than downsides since the behavior is more predictable, but one downside is that the included libs aren't always up to date and not upgradable in case of security issues
I think I'll go the static route for now as it seems easier to accomplish. https://www.graalvm.org/latest/reference-manual/native-image/guides/build-static-executables/ is good info.
there is once caveat that I will warn you for up-front: the standard musl binary via graalvm has a too small stack size
Cheers!
check out this code: https://github.com/babashka/babashka/blob/fc19382b5e433dfaeb2c29f8e71dbf4e458fc39d/src/babashka/main.clj#L1194-L1212 and all related environment variable usage in the bb project and you should be good to go
also note that aarch64 does not support fully static, so it's almost static there "except glibc"
That's the "mostly static" arrangement they talk about in https://www.graalvm.org/latest/reference-manual/native-image/guides/build-static-executables/ ?
and for "mostly" static it matters to use a low glibc version since that's the only dynamic part