From 940b78a7c08f2eab0d3be37131623412afd6aee7 Mon Sep 17 00:00:00 2001 From: Jolyon Suthers <201621+fenrick@users.noreply.github.com> Date: Wed, 9 Sep 2026 23:51:18 +1000 Subject: [PATCH] fix: install the ARM64 C library so Linux ARM64 links v1.1.0 published no Linux ARM64 assets. Both jobs failed to link with "cannot find crti.o" and "cannot find -lc": gcc-aarch64-linux-gnu only *recommends* libc6-dev-arm64-cross, and the install used --no-install-recommends, so the cross compiler arrived without a target C library. The library is now named explicitly alongside it. CI could not have caught this. It ran `cargo check`, which does not link, so a missing link-time dependency was invisible until a release ran. The targets job now runs `cargo build --release` for all five targets, with the cross toolchain where one is needed, so a link failure surfaces on the pull request that causes it. v1.1.0 keeps its other twelve assets: fail-fast was already disabled on the packaging job, so the failure cost only the two new architectures. --- .github/workflows/ci.yml | 27 ++++++++++++++++++++------- .github/workflows/release.yml | 14 ++++++++++---- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d921982..a3ad604 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,17 +37,26 @@ jobs: - name: Tests run: cargo test --all-features - # The release workflow cross-compiles four targets. Proving they still - # compile here means a release never fails on a platform nobody built. + # The release workflow builds five targets, two of them cross-compiled. + # Building — not merely checking — is the point: `cargo check` does not link, + # and a missing cross C library is a link error. v1.1.0 shipped without its + # Linux ARM64 assets for exactly that reason. targets: - name: Compiles for ${{ matrix.target }} + name: Builds for ${{ matrix.target }} runs-on: ${{ matrix.os }} + # Only consulted when building the matching target. + env: + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc strategy: fail-fast: false matrix: include: - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest } - - { target: aarch64-unknown-linux-gnu, os: ubuntu-latest } + - { + target: aarch64-unknown-linux-gnu, + os: ubuntu-latest, + apt: "gcc-aarch64-linux-gnu libc6-dev-arm64-cross", + } - { target: aarch64-apple-darwin, os: macos-latest } - { target: x86_64-pc-windows-msvc, os: windows-latest } - { target: aarch64-pc-windows-msvc, os: windows-latest } @@ -58,13 +67,17 @@ jobs: with: targets: ${{ matrix.target }} + - name: Install cross toolchain + if: matrix.apt != '' + run: | + sudo apt-get update + sudo apt-get install --yes --no-install-recommends ${{ matrix.apt }} + - uses: Swatinem/rust-cache@v2 with: key: ${{ matrix.target }} - # `check` does not link, so no cross-linker is needed here. Linking is - # exercised by the release workflow. - - run: cargo check --all-targets --target ${{ matrix.target }} + - run: cargo build --release --target ${{ matrix.target }} # Guard the promise the README makes: an ordinary export carries no personal # data, and no real document is ever committed. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 942fd82..ee005e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: matrix: include: - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest } - - { target: aarch64-unknown-linux-gnu, os: ubuntu-latest, apt: gcc-aarch64-linux-gnu } + - { target: aarch64-unknown-linux-gnu, os: ubuntu-latest, apt: "gcc-aarch64-linux-gnu libc6-dev-arm64-cross" } - { target: aarch64-apple-darwin, os: macos-latest } - { target: x86_64-pc-windows-msvc, os: windows-latest } - { target: aarch64-pc-windows-msvc, os: windows-latest } @@ -64,7 +64,10 @@ jobs: with: targets: ${{ matrix.target }} - - name: Install cross-linker + # The cross compiler only *recommends* the target C library, so the + # library has to be named explicitly alongside it: without it the linker + # reports "cannot find crti.o" and "cannot find -lc". + - name: Install cross toolchain if: matrix.apt != '' run: | sudo apt-get update @@ -113,7 +116,7 @@ jobs: matrix: include: - { target: x86_64-unknown-linux-gnu, arch: amd64 } - - { target: aarch64-unknown-linux-gnu, arch: arm64, apt: gcc-aarch64-linux-gnu } + - { target: aarch64-unknown-linux-gnu, arch: arm64, apt: "gcc-aarch64-linux-gnu libc6-dev-arm64-cross" } steps: - uses: actions/checkout@v7 with: @@ -123,7 +126,10 @@ jobs: with: targets: ${{ matrix.target }} - - name: Install cross-linker + # The cross compiler only *recommends* the target C library, so the + # library has to be named explicitly alongside it: without it the linker + # reports "cannot find crti.o" and "cannot find -lc". + - name: Install cross toolchain if: matrix.apt != '' run: | sudo apt-get update