From 2148614e8b1db25b92ee422da44408bbab16a242 Mon Sep 17 00:00:00 2001 From: iximeow Date: Fri, 27 Sep 2024 02:26:25 +0000 Subject: [PATCH 1/2] quasi-lock dependencies in omicron-common --- .github/buildomat/jobs/omicron-common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/buildomat/jobs/omicron-common.sh b/.github/buildomat/jobs/omicron-common.sh index e9e2774cd2..426eb64dbd 100755 --- a/.github/buildomat/jobs/omicron-common.sh +++ b/.github/buildomat/jobs/omicron-common.sh @@ -21,5 +21,6 @@ cd /tmp cargo new --lib test-project cd test-project cargo add omicron-common --path /work/oxidecomputer/omicron/common +cp /work/oxidecomputer/omicron/Cargo.lock Cargo.lock cargo check cargo build --release From 278ca2e40b1e643367f9086097500770325319ef Mon Sep 17 00:00:00 2001 From: iximeow Date: Fri, 27 Sep 2024 02:47:03 +0000 Subject: [PATCH 2/2] explain why we do the weird thing --- .github/buildomat/jobs/omicron-common.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/buildomat/jobs/omicron-common.sh b/.github/buildomat/jobs/omicron-common.sh index 426eb64dbd..0e248f9d3d 100755 --- a/.github/buildomat/jobs/omicron-common.sh +++ b/.github/buildomat/jobs/omicron-common.sh @@ -21,6 +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