Skip to content

Commit c90d7ce

Browse files
committed
fix: Removing the index forces a clean fetch, against which Cargo.lock resolves cleanly — keeping this dry-run deterministic.
Signed-off-by: habeck <habeck@us.ibm.com>
1 parent 4ff401c commit c90d7ce

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,28 @@ jobs:
109109
fetch-depth: 1
110110
- name: Install Rust 1.96.0
111111
uses: dtolnay/rust-toolchain@1.96.0
112-
# NOTE: intentionally NO Swatinem/rust-cache here. rust-cache restores a
113-
# partial `~/.cargo/registry` index ("full match: false"); with the sparse
114-
# protocol, `cargo package --locked` consults that stale local index, finds
115-
# it can't satisfy the committed lock, and aborts with "cannot update the
116-
# lock file" (fails ~1.4s in — too fast for a real network fetch) even
117-
# though Cargo.lock resolves cleanly against a fresh index. Fetching the
118-
# index fresh each run keeps this dry-run deterministic.
112+
# NOTE: intentionally NO Swatinem/rust-cache here, AND we wipe the registry
113+
# index before packaging. The committed Cargo.lock is byte-identical to a
114+
# fresh x86_64 resolution (verified in an amd64 container), so the lock is
115+
# not the problem. The failure comes from stale `~/.cargo/registry` state
116+
# the hosted runner carries: under the sparse protocol `cargo package
117+
# --locked` consults that partial local index, decides it can't satisfy the
118+
# committed lock, and aborts with "cannot update the lock file ... --locked"
119+
# ~1.4s in (too fast for a real network fetch). Removing the index forces a
120+
# clean fetch, against which Cargo.lock resolves cleanly — keeping this
121+
# dry-run deterministic.
119122
# Continuous dry-run of the crates.io release: build + verify a .crate for
120123
# every publishable member without uploading. Catches publishability
121124
# regressions (missing version reqs, packaging-excluded files, broken
122125
# inter-crate deps) on every push/PR, long before a release tag. Mirrors
123126
# `make publish-dry` and the release workflow's dry-run. The two
124127
# `publish = false` FFI crates are excluded (not part of the registry set).
125128
- name: cargo package (no upload)
126-
run: cargo package --workspace --locked --exclude cpex-ffi --exclude cpex-demo-ffi
129+
run: |
130+
# Drop any pre-seeded registry index/cache so cargo fetches fresh and
131+
# --locked resolves against a clean index (see note above).
132+
rm -rf ~/.cargo/registry/index ~/.cargo/registry/cache
133+
cargo package --workspace --locked --exclude cpex-ffi --exclude cpex-demo-ffi
127134
128135
docs:
129136
name: Docs Build

0 commit comments

Comments
 (0)