Skip to content

fix: self-heal Cargo.lock in Release instead of depending on release-please - #44

Merged
mulhamna merged 1 commit into
mainfrom
fix/build-self-sync-cargo-lock
Aug 13, 2026
Merged

fix: self-heal Cargo.lock in Release instead of depending on release-please#44
mulhamna merged 1 commit into
mainfrom
fix/build-self-sync-cargo-lock

Conversation

@mulhamna

Copy link
Copy Markdown
Member

Summary

Changes

  • .github/workflows/release.yml: both verify and each build matrix job now run cargo update -p forgeguard --precise <tag-version> right after the toolchain is installed, before anything --locked. This touches only the forgeguard workspace member's own lock entry — verified locally, not guessed.
  • release-please-config.json: reverted the non-functional /Cargo.lock extra-file from fix: let release-please manage Cargo.lock's version entry #41.

Verified locally before pushing (per your ask not to keep guessing)

  1. Bumped crates/forgeguard-cli/Cargo.toml to 0.11.2 without touching Cargo.lock — reproduced the exact CI failure (cargo build --locked → "cannot update the lock file").
  2. Ran cargo update -p forgeguard --precise 0.11.2 — diff showed exactly one line changed (forgeguard's version), cargo itself reported "9 unchanged dependencies".
  3. Re-ran cargo build --locked --release -p forgeguard — succeeded.
  4. Ran the same --precise command with the version already current — no-op, exit 0, no diff (safe to always run unconditionally).
  5. Reverted the local test changes before committing anything.

Sequencing

This needs to merge before PR #43 (chore(main): release 0.11.2) merges, so the chained Release job picks up the self-heal step from main's latest release.yml when it runs. PR #43's tagged commit will still carry a stale Cargo.lock either way (unavoidable, same as #41 not fixing that at the source) — this fix means that no longer matters.

Test plan

  • Reproduced the failure and verified the fix locally, described above
  • Both changed files validated as well-formed YAML/JSON
  • After merging this + PR chore(main): release 0.11.2 #43, confirm Release's build matrix jobs all succeed (not just verify) and all assets upload
  • Confirm npm-publish fires and @suiflex/forgeguard@0.11.2 publishes

…ease

Verified locally before pushing this time: staged the exact drift
(Cargo.toml bumped, Cargo.lock left behind), confirmed cargo build
--locked fails the same way CI did, then confirmed cargo update -p
forgeguard --precise <version> fixes only the forgeguard entry
(cargo reports "9 unchanged dependencies") and the --locked build
succeeds afterward. Also checked the version-already-current case
is a safe no-op.

The /Cargo.lock extra-file from #41 didn't work in practice -
release-please logged "No entries modified in
$.package[?(@.name==\"forgeguard\")].version" despite the filter
matching fine against a plain TOML parse locally, so their internal
TOML handling isn't behaving the way I assumed. Reverting that dead
config rather than leaving a misleading no-op in place.

This makes Release self-sufficient: it no longer depends on
release-please (or any other PR) getting Cargo.lock right in the
tagged commit. Every release, tag-verify and build now pin
Cargo.lock's forgeguard entry to the tag's own version before
running anything --locked, so the tagged commit's actual Cargo.lock
content stops mattering.
@mulhamna
mulhamna merged commit 11ba611 into main Aug 13, 2026
3 checks passed
@mulhamna
mulhamna deleted the fix/build-self-sync-cargo-lock branch August 14, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant