Cargo: force --precise fallback for lockstep family updates - #16115
Draft
kbukum1 wants to merge 1 commit into
Draft
Cargo: force --precise fallback for lockstep family updates#16115kbukum1 wants to merge 1 commit into
kbukum1 wants to merge 1 commit into
Conversation
kbukum1
force-pushed
the
kbukum1/cargo-futures-lockstep-precise-update
branch
from
August 31, 2026 19:07
ea57e6a to
adaab52
Compare
kbukum1
marked this pull request as draft
August 31, 2026 19:11
kbukum1
force-pushed
the
kbukum1/cargo-futures-lockstep-precise-update
branch
from
August 31, 2026 19:28
adaab52 to
366c51a
Compare
kbukum1
force-pushed
the
kbukum1/cargo-futures-lockstep-precise-update
branch
from
August 31, 2026 20:11
366c51a to
331bee4
Compare
kbukum1
force-pushed
the
kbukum1/cargo-futures-lockstep-precise-update
branch
from
August 31, 2026 20:27
331bee4 to
a51ef7d
Compare
kbukum1
force-pushed
the
kbukum1/cargo-futures-lockstep-precise-update
branch
from
August 31, 2026 20:48
a51ef7d to
6f76c1e
Compare
kbukum1
force-pushed
the
kbukum1/cargo-futures-lockstep-precise-update
branch
from
August 31, 2026 21:00
6f76c1e to
db216a1
Compare
kbukum1
force-pushed
the
kbukum1/cargo-futures-lockstep-precise-update
branch
from
August 31, 2026 21:17
db216a1 to
6d65198
Compare
kbukum1
force-pushed
the
kbukum1/cargo-futures-lockstep-precise-update
branch
from
August 31, 2026 21:23
6d65198 to
9396d70
Compare
kbukum1
requested
a balanced review from Copilot
and removed request for
Copilot
August 31, 2026 21:23
kbukum1
requested
a balanced review from Copilot
and removed request for
Copilot
August 31, 2026 21:24
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 3
New issues introduced by this change (3)
| Severity | Finding |
|---|---|
cargo/lib/dependabot/cargo/file_updater/lockfile_updater.rb — The signature includes each package block verbatim, so a change to the package's outgoing… |
|
cargo/lib/dependabot/cargo/file_updater/lockfile_updater.rb — This collects only the referenced target strings and discards the parent package for each incoming… |
|
cargo/spec/dependabot/cargo/file_updater/lockfile_updater_spec.rb — This spec explicitly resolves against the live crates.io registry, making the Cargo suite… |
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
cargo/spec/dependabot/cargo/file_updater/lockfile_updater_spec.rb — --precise 0.3.34 constrains only the selected futures package; its sibling requirements are… View resolved comment |
Comment on lines
+528
to
+530
| # exact version and checksum. The siblings are pulled via `^0.3.34` | ||
| # requirements and may legitimately resolve to a newer 0.3.x from the | ||
| # live registry, so only assert that none of them are left at 0.3.33. |
- Enhance lockfile updater to force precise updates for dependencies requiring coordinated version changes. - Add tests to validate behavior for shared dependency families in various workspace scenarios. - Introduce necessary fixture files for testing lockstep updates across multiple crates.
kbukum1
force-pushed
the
kbukum1/cargo-futures-lockstep-precise-update
branch
from
August 31, 2026 21:45
9396d70 to
b31ffc5
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Review tier: Balanced
Findings: 1
Pre-existing issues (1)
| Severity | Finding |
|---|---|
cargo/spec/dependabot/cargo/file_updater/lockfile_updater_spec.rb — This spec explicitly resolves against the live crates.io registry, making the Cargo suite… View comment |
Issues resolved since last review (2)
| Severity | Finding |
|---|---|
cargo/lib/dependabot/cargo/file_updater/lockfile_updater.rb — This collects only the referenced target strings and discards the parent package for each incoming… View resolved comment |
|
cargo/lib/dependabot/cargo/file_updater/lockfile_updater.rb — The signature includes each package block verbatim, so a change to the package's outgoing… View resolved comment |
Suppressed comments (2)
cargo/lib/dependabot/cargo/file_updater/lockfile_updater.rb:135
- This only compares the state immediately around the current command. In a grouped update, an earlier dependency command can already repoint this dependency to the target while retaining the old entry for another constrained consumer; the current plain command then makes no change, this condition returns true, and
--preciseis run against the legitimately retained old package—the same doomed operation the edge check is intended to avoid. Preserve a pre-run signature (or otherwise detect movement that occurred before this command) and cover the retained-old-entry, multi-dependency case.
return false if dependency_move_signature(lockfile_before, dependency) !=
dependency_move_signature(lockfile_after, dependency)
package_version_count(lockfile_after, dependency, previous_version).positive?
cargo/lib/dependabot/cargo/file_updater/lockfile_updater.rb:807
- The parent qualifier omits
source, although Cargo can contain two parent packages with the same name/version from different sources. If those parents swapfooversions, both edge arrays sort to the same values, so a real edge move is misclassified as a no-op and the fallback may force a doomed update. Include the parent's source in its identity.
parent_id = [block[/^name = "[^"]+"$/], block[/^version = "[^"]+"$/]].compact.join(" ")
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Fixes #16092
What are you trying to accomplish?
futures 0.3.34requiresfutures-*at^0.3.34) and those siblings are shared across workspace members, a plain single-packagecargo updatecan't move them and silently leaves the line unchanged.--preciseretry only when the plain update leaves the dependency stuck, forcing the coordinated family update.Anything you want to highlight for special attention from reviewers?
--preciseretry fires only when the dep is still pinned at its previous version.[[package]]entries and its incoming edges before/after, so an edge repointed onto an already-present target entry is correctly treated as a real move (avoids forcing a doomed--precisewhen the target already coexists).How will you know you've accomplished your goal?
--preciseretry resolves it.Checklist