Add rolling release built with Zig's musl toolchain
Build a static Linux x86_64 binary with zig cc, linking OpenSSL in and serving it to moonbitlang/async through a dlopen shim. CI publishes it to the rolling release on every push to main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3ca9e8ed1d
commit
2d815bbb75
9 files changed
+368
No files matched your search
@@ -146,6 +146,28 @@ docker run -d -p 5000:5000 registry:2
|
||||
orbit channel add local localhost:5000/pkgs --plain-http
|
||||
```
|
||||
|
||||
## Rolling release
|
||||
|
||||
Every push to `main` that passes the tests replaces the
|
||||
[`rolling` release](https://git.site.latha.org/nandi/orbit/releases/tag/rolling)
|
||||
with a static Linux x86_64 binary. It doesn't need glibc or OpenSSL, only `tar`,
|
||||
`/bin/sh`, and the system's CA certificates (`ca-certificates` on most distros;
|
||||
set `SSL_CERT_FILE` if they live somewhere unusual).
|
||||
|
||||
```sh
|
||||
base=https://git.site.latha.org/nandi/orbit/releases/download/rolling
|
||||
curl -fLO "$base/orbit-linux-x86_64" -fLO "$base/SHA256SUMS" &&
|
||||
sha256sum -c SHA256SUMS &&
|
||||
install -Dm755 orbit-linux-x86_64 ~/.local/bin/orbit
|
||||
```
|
||||
|
||||
`just build-musl` makes the same binary locally in `dist/`. It needs `zig`,
|
||||
`perl`, `make`, and `curl`. [scripts/build-musl.sh](scripts/build-musl.sh) compiles
|
||||
MoonBit's C output and a pinned OpenSSL with `zig cc -target x86_64-linux-musl`.
|
||||
`moonbitlang/async` normally loads OpenSSL with `dlopen`, which static binaries
|
||||
can't do, so [openssl_static.c](scripts/musl/openssl_static.c) supplies the
|
||||
linked-in functions instead.
|
||||
|
||||
## Building
|
||||
|
||||
```sh
|
||||
|
||||
Reference in new issue
Block a user