From 94a68fa08e1d7ec2b265a977943e670d61ff3eca Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 22 Jun 2026 00:45:05 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20broken=20cargo=20on=20arm6?= =?UTF-8?q?4=20and=20remove=20cargo-info=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sccache source compilation fails for aarch64-musl (openssl-sys has no musl cross-compile headers). With RUSTC_WRAPPER=sccache set unconditionally, any arm64 image user who ran cargo hit an immediate exec error. Guard the wrapper so it is only set when sccache is actually present in PATH. cargo-info v0.7.7 depends on openssl-sys and has no arm64-musl prebuilt on QuickInstall or GitHub Releases. It was wasting ~15 min of cold-cache build time before failing. Remove it from the tool list. sccache is now installed as a separate binstall-only line (no source fallback) so it silently skips on targets where no prebuilt exists, rather than blocking the build for 15 minutes before failing. - Dockerfile: remove cargo-info from bulk list; extract sccache to standalone `cargo binstall ... 2>/dev/null || true` (prebuilt-only) - rootfs/root/docker/setup/05-custom.sh: guard SCCACHE_DIR and RUSTC_WRAPPER inside `if command -v sccache` block Dockerfile rootfs/root/docker/setup/05-custom.sh --- Dockerfile | 3 +-- rootfs/root/docker/setup/05-custom.sh | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d3d0538..2230a98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -94,7 +94,6 @@ RUN --mount=type=cache,id=cargo-registry-native,sharing=shared,target=/usr/local cargo-update \ cargo-outdated \ cargo-expand \ - cargo-info \ bacon \ cargo-llvm-cov \ cargo-tarpaulin \ @@ -120,7 +119,6 @@ RUN --mount=type=cache,id=cargo-registry-native,sharing=shared,target=/usr/local cargo-asm \ mdbook \ mdbook-toc \ - sccache \ typos-cli \ taplo-cli \ cargo-sort \ @@ -132,6 +130,7 @@ RUN --mount=type=cache,id=cargo-registry-native,sharing=shared,target=/usr/local cargo-spellcheck \ cargo-geiger \ grcov || true; \ + cargo binstall -y --target "${RUST_TARGET}" sccache 2>/dev/null || true; \ cargo binstall -y --target "${RUST_TARGET}" cargo-nextest 2>/dev/null || \ cargo install --locked --target "${RUST_TARGET}" cargo-nextest || true; \ cargo binstall -y --target "${RUST_TARGET}" cargo-dist 2>/dev/null || \ diff --git a/rootfs/root/docker/setup/05-custom.sh b/rootfs/root/docker/setup/05-custom.sh index 4d3077a..b6aa557 100755 --- a/rootfs/root/docker/setup/05-custom.sh +++ b/rootfs/root/docker/setup/05-custom.sh @@ -210,8 +210,10 @@ export RUSTUP_HOME="${RUSTUP_HOME}" export CARGO_HOME="${CARGO_HOME}" export RUSTUP_TOOLCHAIN="stable" export PATH="${CARGO_HOME}/bin:\${PATH}" -export SCCACHE_DIR="\${SCCACHE_DIR:-/root/.cache/sccache}" -export RUSTC_WRAPPER="\${RUSTC_WRAPPER:-sccache}" +if command -v sccache > /dev/null 2>&1; then + export SCCACHE_DIR="\${SCCACHE_DIR:-/root/.cache/sccache}" + export RUSTC_WRAPPER="\${RUSTC_WRAPPER:-sccache}" +fi export CARGO_INCREMENTAL="\${CARGO_INCREMENTAL:-0}" PROFILE