Repository navigation
bazel: enforce MODULE.bazel.lock sync with Cargo.lock - #11790
Merged
Merged
Conversation
joshka-oai
requested review from
bolinfest and
zbarsky-openai
and removed request for
zbarsky-openai
February 13, 2026 23:01
joshka-oai
force-pushed
the
joshka/bazel-lockfile-sync-check
branch
from
February 13, 2026 23:01
f5eb56e to
148e25d
Compare
Add a shared lockfile check script that verifies lockfile freshness with `bazel mod deps --lockfile_mode=error` so stale `MODULE.bazel.lock` fails fast without mutating files. Wire local commands for explicit lockfile workflows: - `just bazel-lock-update` uses `--lockfile_mode=update` - `just bazel-lock-check` runs the non-mutating verify script Run the same check in Bazel CI on one Linux job so lockfile drift is caught consistently. Document the expected dependency-update flow in `codex-rs/docs/bazel.md` and add matching guidance in `AGENTS.md`. Refresh `MODULE.bazel.lock` to match current Cargo resolution.
joshka-oai
force-pushed
the
joshka/bazel-lockfile-sync-check
branch
from
February 13, 2026 23:21
148e25d to
011b070
Compare
zbarsky-openai
approved these changes
Feb 13, 2026
joshka-oai
enabled auto-merge (squash)
February 13, 2026 23:45
Contributor
Author
|
Bazel failures here look unrelated to this lockfile change.
I opened #11799 to make that test hermetic by inlining a tiny valid PNG. Regression appears to come from #10590 (cc: @charley-oai). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this change
When Cargo dependencies change, it is easy to end up with an unexpected local diff in
MODULE.bazel.lockafter running Bazel. That creates noisy working copies and pushes lockfile fixeslater in the cycle. This change addresses that pain point directly.
What this change enforces
The expected invariant is: after dependency updates,
MODULE.bazel.lockis already in sync withCargo resolution. In practice, running
bazel mod depsshould not mutate the lockfile in a cleanstate. If it does, the dependency update is incomplete.
How this is enforced
This change adds a single lockfile check script that snapshots
MODULE.bazel.lock, runsbazel mod deps, and fails if the file changes. The same check is wired into local workflowcommands (
just bazel-lock-updateandjust bazel-lock-check) and into Bazel CI (Linux x86_64 job)so drift is caught early and consistently. The developer documentation is updated in
codex-rs/docs/bazel.mdandAGENTS.mdto make the expected flow explicit.MODULE.bazel.lockis also refreshed in this PR to match the current Cargo dependency resolution.Expected developer workflow
After changing
Cargo.tomlorCargo.lock, runjust bazel-lock-update, then runjust bazel-lock-check, and include any resultingMODULE.bazel.lockupdate in the same change.Testing
Ran
just bazel-lock-checklocally.