fix(cargo): honor package = "..." rename when resolving internal deps (#1858)#1861
Open
thejesh23 wants to merge 1 commit into
Open
fix(cargo): honor package = "..." rename when resolving internal deps (#1858)#1861thejesh23 wants to merge 1 commit into
package = "..." rename when resolving internal deps (#1858)#1861thejesh23 wants to merge 1 commit into
Conversation
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
[dependencies]table entry as(dep_key, spec)and, whenspecis an inline table with apackage = "..."field, uses the override as the lookup key intocrates. Without this, every renamed workspace-internal dep silently dropped itscrate_depends_onedge — the crate node still existed, but the edge to it did not.db,mq,auth) without colliding with crates.io, and in workspaces that vendor two versions of the same crate under different local aliases. Docs: The Cargo Book → Specifying dependencies → Renaming dependencies in Cargo.toml.tests/test_cargo_introspect.py:test_cargo_introspect_honors_package_rename_on_internal_dep—db = { path = "../storage", package = "internal-storage" }now produces thecrate:app → crate:internal-storageedge.test_cargo_introspect_package_rename_falls_through_when_unresolved— a rename pointing at an external crate (tokio_rt = { version = "1", package = "tokio" }) still produces no edge, so the fix doesn't invent edges to registry crates.Closes #1858.
Test plan
uv run --frozen pytest tests/test_cargo_introspect.py -v→ 8 passed (up from 6).uv run --frozen pytest tests/ -q→ 3195 passed, 3 skipped.uv run --frozen pre-commit run --files graphify/cargo_introspect.py tests/test_cargo_introspect.py→ skillgen + ruff green.