From 15a461da9645a40e44216ea06089e0ac37163270 Mon Sep 17 00:00:00 2001 From: Mike Lyons Date: Thu, 19 Nov 2026 13:35:44 -0500 Subject: [PATCH] fix(release): accept static-pie musl binaries in the static check Rust links x86_64 musl as static-pie, which file(1) reports as "static-pie linked", so the grep for "statically linked" failed the rehearsal. Check for the absence of a PT_INTERP segment instead, and point the README install command at v0.2.0 (v0.1.0 is the Python wheel). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 11 ++++++++++- README.md | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c8e3e3..4de3bed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,16 @@ jobs: - name: Check a Linux binary really is static if: matrix.musl - run: file target/${{ matrix.target }}/release/loch | grep -q "statically linked" + # Rust links x86_64 musl as static-pie, which `file` reports as + # "static-pie linked" rather than "statically linked". What makes a + # binary static either way is having no program interpreter. + run: | + bin=target/${{ matrix.target }}/release/loch + file "$bin" + if readelf -l "$bin" | grep -q INTERP; then + echo "$bin requests a dynamic loader" >&2 + exit 1 + fi - name: Package run: | diff --git a/README.md b/README.md index ee21025..44b41c5 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ loch is a single static binary. Take the one for your platform from [GitHub releases](https://github.com/ness-dev/loch/releases), for example: ```sh -curl -L https://github.com/ness-dev/loch/releases/download/v0.1.0/loch-0.1.0-aarch64-apple-darwin.tar.gz \ - | tar xz --strip-components 1 -C ~/.local/bin loch-0.1.0-aarch64-apple-darwin/loch +curl -L https://github.com/ness-dev/loch/releases/download/v0.2.0/loch-0.2.0-aarch64-apple-darwin.tar.gz \ + | tar xz --strip-components 1 -C ~/.local/bin loch-0.2.0-aarch64-apple-darwin/loch loch --version ``` @@ -140,7 +140,7 @@ ref=$(loch save --json --store /tmp/outbound | jq -r .ref) loch restore --json "$ref" --into /path/to/repo --store /tmp/outbound loch --version --json -# {"schema":2,"ok":true,"command":"version","version":"0.1.0"} +# {"schema":2,"ok":true,"command":"version","version":"0.2.0"} ``` Failures are documents too, on stdout, so one stream carries both outcomes: