From 73104e5803ab3f6df78ad7a265c4bdd7de5b8182 Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Tue, 14 Jul 2026 14:14:39 -0400 Subject: [PATCH] CI: fail fast when the egui fork's patch doesn't apply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A [patch.crates-io] whose version doesn't satisfy the dependency requirement is silently IGNORED by cargo — it emits a warning ('patch was not used in the crate graph') and builds against the real crates.io crate instead. The 1.0.10-alpha release build hit exactly this: the fork's version bump to 0.33.3 had never been committed, so CI cloned 0.33.2, the patch was dropped, and the build failed four minutes later with 'cannot find type CursorImage' in a file that had nothing to do with the cause. The one line that explained it was scrolled far above the errors. Check for the warning right after cloning the fork and fail there, naming both versions. --- .github/workflows/build.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 379155f..8fb8672 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,27 @@ jobs: with: targets: ${{ matrix.target != '' && matrix.target || '' }} + # A [patch.crates-io] whose version doesn't satisfy the dependency requirement is silently + # IGNORED by cargo: it warns "patch ... was not used in the crate graph" and builds against the + # real crates.io crate instead. That's how a stale egui fork got us a `cannot find type + # CursorImage` error four minutes into the build, in a file that had nothing to do with the + # cause. Fail here instead, with the actual reason. + - name: Verify egui fork patch applies + shell: bash + working-directory: ./lightningbeam-ui + run: | + unused=$(cargo metadata --format-version 1 2>&1 >/dev/null | grep "was not used in the crate graph" || true) + if [ -n "$unused" ]; then + echo "::error::The egui fork's [patch.crates-io] entries are being ignored — cargo is building against stock crates.io egui, not the fork." + echo "$unused" + echo "" + echo "The fork's version must SATISFY the requirement in lightningbeam-ui/Cargo.toml." + echo "Fork workspace version: $(grep -m1 '^version' ../egui-fork/Cargo.toml)" + echo "Required by us: $(grep -m1 '^eframe' Cargo.toml)" + exit 1 + fi + echo "egui fork patch applies cleanly." + - name: Rust cache uses: swatinem/rust-cache@v2 with: