-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Cargo should print appropriate relative paths when being run from a non-root folder #9887
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently, if you run
cargocommands from a place that is not the root (workspace root for workspace projects), it does (almost1) the same thing as if you had runcargo <foo> -p packagenamefrom the workspace root.This means that the diagnostics also assume you are at the workspace root:
It would be nice if cargo could tell rustc where it is being invoked from, so that rustc may print appropriate paths. A lot of IDEs and terminals have the ability to click on paths in compiler output to open files; and it's frustrating that this only works if you
cargo build -p packagefrom the workspace root.1 I believe there are some slight differences as to which dependencies get built when you call
cargo build -p foofrom the root vs a folder that depends onfooSee also
Summary Notes
Managed by
@rustbot—see help for details