Skip to content

fix(rust): resolve literal paths from the workspace root too - #231

Merged
adityankale190895 merged 3 commits into
DiffCI:mainfrom
FredApps:rust/workspace-root-literals
Nov 18, 2026
Merged

adityankale190895 merged 3 commits into
DiffCI:mainfrom
FredApps:rust/workspace-root-literals

Conversation

@FredApps

Copy link
Copy Markdown
Contributor

Fixes #223

Literal paths are now also resolved from the workspace root, where rustc, proc macros and [env] paths with relative = true (CARGO_WORKSPACE_DIR) start. A root-relative literal like "crates/other/src/lib.rs" now makes the crate depend on other.

From the root, a literal that resolves to the root itself is skipped. So "/", "{}/{}" or "." don't make the crate depend on every crate. A crate-local path such as tests/data/input.bin reaches nothing new in a virtual workspace. With a root package, it can now add an edge to the root crate. That over-runs (fails closed), but it doesn't miss anything.

The new test covers a CARGO_WORKSPACE_DIR join and a concat! of the whole crates/ directory, and checks that the root-only literals add nothing.

Validation (Linux, Node 22, Cargo 1.100): npm run typecheck and the Rust test files (tests/repo/rust-*.test.ts, tests/planner/rust-command.test.ts) pass. The new test fails on main and passes here.

@FredApps
FredApps marked this pull request as ready for review November 17, 2026 17:41
I, FredApps <[email protected]>, hereby add my Signed-off-by to this commit: d6cd46d
I, FredApps <[email protected]>, hereby add my Signed-off-by to this commit: 28b49a3

Signed-off-by: FredApps <[email protected]>
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.

Rust adapter: literal paths anchored at the workspace root (CARGO_WORKSPACE_DIR) don't become dependencies

2 participants