From d9686c934469455108994eb04b45d6971128ea16 Mon Sep 17 00:00:00 2001 From: ospab Date: Sat, 18 Jul 2026 17:59:02 +0300 Subject: [PATCH] fix(ci): cap lints when installing cross, so its own code can't fail our build The mipsel-unknown-linux-musl job in v0.4.2-beta.2 failed at "Install cross": cross-rs's own source uses a macro-at-end-of-block pattern (eyre::bail!()) that trips rustc's semicolon_in_expressions_from_macros lint on current toolchains. `cargo install` compiles the installed package as the "local" crate, so Cargo's usual automatic lint-capping for dependencies doesn't apply to cross's own code - and other cross-built targets in the same run (armv7, aarch64-linux, i686-linux) succeeded, so this reads as a race against cross-rs's unpinned `main` branch history (no --rev/--tag) rather than a deterministic break. RUSTFLAGS="--cap-lints=warn" is the standard mechanism for exactly this situation - building a third-party tool against a newer compiler than its own lint config assumed - without touching our own build's lint levels. More robust than pinning to one historical commit, which just relocates the same risk to whenever that pin is next updated. --- .github/workflows/release.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91a6c02..2c72a1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -284,7 +284,15 @@ jobs: - name: Install cross (if not cached) if: ${{ matrix.use_cross && steps.cross-cache.outputs.cache-hit != 'true' }} - run: cargo install cross --git https://github.com/cross-rs/cross.git --locked + # cross-rs's own source (not ours, not a dependency of ours) uses a + # macro-at-end-of-block pattern that trips rustc's + # semicolon_in_expressions_from_macros lint on current toolchains - + # harmless in cross's actual behavior, but `cargo install` compiles + # the installed package as the "local" crate, so dependency lint + # capping doesn't shield it. --cap-lints=warn is the standard escape + # hatch for building a third-party tool against a newer compiler than + # its own lint config assumed; it doesn't touch our own build. + run: RUSTFLAGS="--cap-lints=warn" cargo install cross --git https://github.com/cross-rs/cross.git --locked - name: Build (cross) if: ${{ matrix.use_cross }}