ci(release): drop cross, use rustup targets + native linkers
CI / cargo fmt --check (push) Successful in 22s
CI / cargo clippy (push) Successful in 23s
CI / cargo test (push) Failing after 16m25s
Release / build x86_64-unknown-linux-gnu (push) Failing after 56s
Release / build aarch64-unknown-linux-musl (push) Failing after 56s
Release / build aarch64-unknown-linux-gnu (push) Failing after 1m43s
Release / build x86_64-unknown-linux-musl (push) Failing after 1m31s
Release / gitea release (push) Has been skipped
CI / editor keymaps (push) Has been cancelled

cross spawns Docker containers per target, but the Gitea Actions
runner doesn't expose /var/run/docker.sock, so every cross-compile
step died with "Cannot connect to the Docker daemon".

Replace with rustup-installed targets plus per-target linker setup:
  - x86_64-gnu: native (no extra deps)
  - aarch64-gnu: gcc-aarch64-linux-gnu from apt
  - x86_64-musl: musl-tools from apt
  - aarch64-musl: rust-lld + link-self-contained (rust-std bundles
    musl libc.a + crt, no apt deps needed)

Verified aarch64-musl path locally: produces a statically linked
ARM aarch64 ELF.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-14 22:29:36 +00:00
parent 3ef70e4b7c
commit 82ff454e0f
+28 -14
View File
@@ -19,11 +19,19 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
target: include:
- x86_64-unknown-linux-gnu - target: x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu apt: ""
- x86_64-unknown-linux-musl rustflags: ""
- aarch64-unknown-linux-musl - target: aarch64-unknown-linux-gnu
apt: "gcc-aarch64-linux-gnu"
rustflags: ""
- target: x86_64-unknown-linux-musl
apt: "musl-tools"
rustflags: ""
- target: aarch64-unknown-linux-musl
apt: ""
rustflags: "-C linker=rust-lld -C link-self-contained=yes"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -31,11 +39,16 @@ jobs:
with: with:
targets: ${{ matrix.target }} targets: ${{ matrix.target }}
- name: Install cross toolchain
if: matrix.apt != ''
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends ${{ matrix.apt }}
- name: Cache cargo state - name: Cache cargo state
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
~/.cargo/bin
~/.cargo/registry ~/.cargo/registry
~/.cargo/git ~/.cargo/git
target target
@@ -43,14 +56,15 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-cargo-release-${{ matrix.target }}- ${{ runner.os }}-cargo-release-${{ matrix.target }}-
- name: Install cross - name: Build nuwiki-ls
run: | env:
if ! command -v cross >/dev/null 2>&1; then # Per-target linker overrides. Cargo ignores the entries that
cargo install cross --locked --version 0.2.5 # don't match the current target, so setting all of them here
fi # keeps the matrix declarative.
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
- name: Cross-compile nuwiki-ls CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: musl-gcc
run: cross build --release --target ${{ matrix.target }} -p nuwiki-ls RUSTFLAGS: ${{ matrix.rustflags }}
run: cargo build --release --target ${{ matrix.target }} -p nuwiki-ls
- name: Package archive - name: Package archive
id: package id: package