From d6ab83fc2eea8e18f54b9ed55210e7944d942daa Mon Sep 17 00:00:00 2001 From: fristyxd Date: Tue, 17 Nov 2026 16:06:00 +0300 Subject: [PATCH] fix(release): build the Linux CLI against musl The x86-64 artifact was built on the 26.10 runner image and required glibc 2.44, so it failed on older distributions. Build both Linux targets statically with the image's zig toolchain and fail the job when the result is not static. --- .gitea/workflows/ci.yml | 10 ++++++++-- .gitea/workflows/release.yml | 29 ++++++++++++++++++++++++++--- CHANGELOG.md | 7 +++++++ packaging/nfpm-cli.yaml | 8 -------- 4 files changed, 41 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index a8c7ad0..c5aad4c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -140,8 +140,7 @@ jobs: cli-arm64: name: CLI (linux-arm64, static) runs-on: ubuntu-latest - timeout-minutes: 45 - continue-on-error: true + timeout-minutes: 60 steps: - uses: actions/checkout@v7 @@ -156,6 +155,13 @@ jobs: restore-keys: | ${{ runner.os }}-cargo-arm64-check- + - name: Add the static Linux targets + run: rustup target add x86_64-unknown-linux-musl + - name: Cross-compile for arm64 working-directory: cli run: cargo zigbuild --target aarch64-unknown-linux-musl --no-default-features + + - name: Cross-compile for x86-64 + working-directory: cli + run: cargo zigbuild --target x86_64-unknown-linux-musl diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index af4cc37..43d2d45 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -56,10 +56,11 @@ jobs: include: - name: linux-x64 os: ubuntu-latest - target: x86_64-unknown-linux-gnu + target: x86_64-unknown-linux-musl artifact: frislit-linux-x64 ext: "" is_linux: true + is_musl: true deb_arch: amd64 rpm_arch: x86_64 - name: windows-x64 @@ -103,13 +104,25 @@ jobs: "$env:USERPROFILE\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Append } + - name: Add the static Linux target + if: matrix.is_musl + shell: bash + run: rustup target add ${{ matrix.target }} + - name: Stamp the version shell: bash env: VERSION: ${{ needs.prepare.outputs.version }} run: sed -i "s/^version = \".*\"/version = \"$VERSION\"/" cli/Cargo.toml + - name: Build the CLI (static) + if: matrix.is_musl + shell: bash + working-directory: cli + run: cargo zigbuild --release --target ${{ matrix.target }} + - name: Build the CLI + if: ${{ !matrix.is_musl }} shell: bash working-directory: cli run: cargo build --release --target ${{ matrix.target }} @@ -120,6 +133,12 @@ jobs: mkdir -p dist cp "cli/target/${{ matrix.target }}/release/frislit${{ matrix.ext }}" "dist/${{ matrix.artifact }}" + - name: Check that the Linux binary is static + if: matrix.is_linux + shell: bash + run: | + file "dist/${{ matrix.artifact }}" | tee /dev/stderr | grep -Eq 'static(ally|-pie) linked' + - name: Build the .deb and the .rpm if: matrix.is_linux shell: bash @@ -180,7 +199,6 @@ jobs: needs: prepare runs-on: ubuntu-latest timeout-minutes: 60 - continue-on-error: true permissions: contents: write steps: @@ -213,6 +231,11 @@ jobs: cp cli/target/aarch64-unknown-linux-musl/release/frislit stage/cli/frislit chmod +x stage/cli/frislit + - name: Check that the binary is static + shell: bash + run: | + file dist/frislit-linux-arm64 | tee /dev/stderr | grep -Eq 'static(ally|-pie) linked' + - name: Build the .deb and the .rpm env: PKG_VERSION: ${{ needs.prepare.outputs.semver }} @@ -380,7 +403,7 @@ jobs: publish: name: Publish release - needs: [prepare, cli, server, docker] + needs: [prepare, cli, cli-arm64, server, docker] runs-on: ubuntu-latest timeout-minutes: 10 permissions: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5afe917..69cdfb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning 2.0.0](https://semver.org/spec/ ## [Unreleased] +### Fixed + +- The Linux CLI binaries are statically linked against musl, so they run on any distribution + regardless of its glibc version: `frislit-linux-x64` no longer demands glibc 2.44. +- The CI cross-compile job also builds the x86-64 musl binary, and both Linux jobs fail instead of + passing silently when the static build breaks. + ## [0.3.2] - 2026-11-17 ### Changed diff --git a/packaging/nfpm-cli.yaml b/packaging/nfpm-cli.yaml index bbbb62e..9b00a8f 100644 --- a/packaging/nfpm-cli.yaml +++ b/packaging/nfpm-cli.yaml @@ -11,14 +11,6 @@ vendor: "frislit" homepage: "https://git.fristy.net/fristy/frislit" license: "MIT" -overrides: - deb: - depends: - - libc6 (>= 2.35) - rpm: - depends: - - glibc >= 2.35 - contents: - src: stage/cli/frislit dst: /usr/bin/frislit -- 2.54.1