From d657dd72c27a549379ff83373ddcc55694d6a114 Mon Sep 17 00:00:00 2001 From: Ben Morcos Date: Tue, 3 Mar 2026 15:46:20 -0500 Subject: [PATCH] feat: add musl Linux targets to release workflow Add x86_64-unknown-linux-musl and aarch64-unknown-linux-musl targets to the release CI matrix. musl-linked static libraries enable fully static Go binaries that run in distroless containers without any dependencies. The default cross musl images lack g++ needed by the esaxx-rs transitive dependency, so custom Dockerfiles in cross/ extend the base images with the appropriate cross-compilation C++ toolchain. New release artifacts: - libtokenizers.linux-musl-x86_64.tar.gz (alias: linux-musl-amd64) - libtokenizers.linux-musl-arm64.tar.gz (alias: linux-musl-aarch64) --- .github/workflows/release.yml | 6 ++++++ Cross.toml | 5 +++++ cross/musl-aarch64.Dockerfile | 3 +++ cross/musl-x86_64.Dockerfile | 3 +++ 4 files changed, 17 insertions(+) create mode 100644 Cross.toml create mode 100644 cross/musl-aarch64.Dockerfile create mode 100644 cross/musl-x86_64.Dockerfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7820456..044f0939 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,6 +69,12 @@ jobs: - target: aarch64-unknown-linux-gnu archive_name: libtokenizers.linux-arm64.tar.gz alias_name: libtokenizers.linux-aarch64.tar.gz + - target: x86_64-unknown-linux-musl + archive_name: libtokenizers.linux-musl-x86_64.tar.gz + alias_name: libtokenizers.linux-musl-amd64.tar.gz + - target: aarch64-unknown-linux-musl + archive_name: libtokenizers.linux-musl-arm64.tar.gz + alias_name: libtokenizers.linux-musl-aarch64.tar.gz - target: s390x-unknown-linux-gnu archive_name: libtokenizers.linux-s390x.tar.gz alias_name: "" diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 00000000..351df7b9 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,5 @@ +[target.x86_64-unknown-linux-musl] +dockerfile = { file = "cross/musl-x86_64.Dockerfile" } + +[target.aarch64-unknown-linux-musl] +dockerfile = { file = "cross/musl-aarch64.Dockerfile" } diff --git a/cross/musl-aarch64.Dockerfile b/cross/musl-aarch64.Dockerfile new file mode 100644 index 00000000..94b52d17 --- /dev/null +++ b/cross/musl-aarch64.Dockerfile @@ -0,0 +1,3 @@ +FROM ghcr.io/cross-rs/aarch64-unknown-linux-musl:main + +RUN apt-get update && apt-get install -y g++-aarch64-linux-gnu && rm -rf /var/lib/apt/lists/* diff --git a/cross/musl-x86_64.Dockerfile b/cross/musl-x86_64.Dockerfile new file mode 100644 index 00000000..455c0ca4 --- /dev/null +++ b/cross/musl-x86_64.Dockerfile @@ -0,0 +1,3 @@ +FROM ghcr.io/cross-rs/x86_64-unknown-linux-musl:main + +RUN apt-get update && apt-get install -y g++-x86-64-linux-gnu && rm -rf /var/lib/apt/lists/*