Skip to content

Commit bd3e173

Browse files
authored
quasi-lock dependencies in omicron-common job (#6692)
"fixes" #6691 by stealing the checked-in Cargo.lock when building the standalone `omicron-common` crate created for this job. this lets us keep the specific refs of git dependencies that are `ref="main"` and similar, which might otherwise resolve to different commits than the rest of the tree (and its `omicron-common`) can actually build with. it'd be nice to have fewer git dependencies using branch names for refs, either by using a cratesio crate or specific commit or _something_, but this seems to make things a bit less brittle in the mean time.
1 parent 9fb967d commit bd3e173

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/buildomat/jobs/omicron-common.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,16 @@ cd /tmp
2121
cargo new --lib test-project
2222
cd test-project
2323
cargo add omicron-common --path /work/oxidecomputer/omicron/common
24+
# Bootstrap `test-project`'s dependencies from the checked-in Cargo.lock.
25+
# This means that `test-project` builds with the same commits as the main repo
26+
# for any dependencies referenced as `{ git = "...", ref = "<branch>" }`. If we
27+
# do not prepopulate `Cargo.lock` like this, an update in a dependency might get
28+
# picked up here and be incompatible with `omicron-common`, causing it to fail
29+
# to build (see Omicron issue #6691).
30+
#
31+
# The extra dependencies in `omicron` will get pruned by Cargo when it
32+
# recalculates dependencies, but any dependencies that match will stay at the
33+
# commit/version/etc already indicated in the lockfile.
34+
cp /work/oxidecomputer/omicron/Cargo.lock Cargo.lock
2435
cargo check
2536
cargo build --release

0 commit comments

Comments
 (0)