diff --git a/.github/buildomat/jobs/omicron-common.sh b/.github/buildomat/jobs/omicron-common.sh index e9e2774cd2e..0e248f9d3d6 100755 --- a/.github/buildomat/jobs/omicron-common.sh +++ b/.github/buildomat/jobs/omicron-common.sh @@ -21,5 +21,16 @@ cd /tmp cargo new --lib test-project cd test-project cargo add omicron-common --path /work/oxidecomputer/omicron/common +# Bootstrap `test-project`'s dependencies from the checked-in Cargo.lock. +# This means that `test-project` builds with the same commits as the main repo +# for any dependencies referenced as `{ git = "...", ref = "" }`. If we +# do not prepopulate `Cargo.lock` like this, an update in a dependency might get +# picked up here and be incompatible with `omicron-common`, causing it to fail +# to build (see Omicron issue #6691). +# +# The extra dependencies in `omicron` will get pruned by Cargo when it +# recalculates dependencies, but any dependencies that match will stay at the +# commit/version/etc already indicated in the lockfile. +cp /work/oxidecomputer/omicron/Cargo.lock Cargo.lock cargo check cargo build --release