Repository navigation
fix(rust): inherit Cargo workspace dependency versions - #614
Open
vibgrate-team wants to merge 1 commit into
Open
vibgrate-team wants to merge 1 commit into
vibgrate-team wants to merge 1 commit into
Conversation
Member crates that set workspace = true and omit version now use the nearest workspace root [workspace.dependencies] pin. A local version, features list, or optional flag still wins. Path-only and git-only tables stay spec *. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
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.
Summary
parseCargoDepAttrstreatedworkspace = trueas “no version,” so a member crate such asserde = { workspace = true }was reported withcurrentSpec*even when the workspace root pinnedserde = "1.0"under[workspace.dependencies].The scan now finds the nearest Cargo.toml at or above the member, and inside the scan root, that contains a
[workspace]table. That file’s[workspace.dependencies]pins are applied when a dependency table setsworkspace = trueand does not set its ownversion:serde = "1.0") and a table pin (version = "…"), including[workspace.dependencies.<crate>], both supply the version.version = "…"wins over the workspace pin.featuresandoptionalare copied from the pin only when the local table does not set them. A localfeatureslist replaces the pin’s list.optional = falseoverrides a workspaceoptional = true.*. No version is invented.devDependencieswhen the inherited pin setsoptional = true.Related issues
Closes #604
Checklist
pnpm testpassespnpm lintis cleanpnpm typecheckis cleangraph.json/ report output (content-hashed IDs, stable sorts; no time,randomness, or filesystem-order dependence)
git commit -s, DCO)Notes for reviewers
Docs were left unchanged. The Cargo notes in
DOCS.mdanddocs/sbom-dependency-scope.mddescribe lockfile resolution and dependency sections, and they do not describe workspace inheritance.The fixture under
test/fixtures/cargo-workspace-member/covers a member crate, a nearer nested workspace (so the scan root pin is not used), and a package that is itself the workspace root.pnpm test(5681 tests),pnpm lint, andpnpm typecheckpassed locally. Lint still reports five existing unused-variable warnings outside this change.