-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Patch git dependency in a workspace or sub-directory #9624
Copy link
Copy link
Closed
Labels
A-crate-dependenciesArea: [dependencies] of any kindArea: [dependencies] of any kindA-documenting-cargo-itselfArea: Cargo's documentationArea: Cargo's documentationC-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`E-easyExperience: EasyExperience: EasyS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or review
Metadata
Metadata
Assignees
Labels
A-crate-dependenciesArea: [dependencies] of any kindArea: [dependencies] of any kindA-documenting-cargo-itselfArea: Cargo's documentationArea: Cargo's documentationC-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`E-easyExperience: EasyExperience: EasyS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or review
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the problem you are trying to solve
Patch syntax allows replacing a dependency's git URL, but it doesn't seem allow to specify a directory in that repository. At least, it is not documented at https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html. Essentially, it is useless when patched crate is a part of a cargo workspace.
Describe the solution you'd like
Two solutions:
More integrated with cargo/rust: specify workspace member's package name, so that cargo will parse manifest and resolve to the required directory automatically.
More general: manually specify sub-directory of a git repository, so that cargo would look for a crate's
Cargo.tomlmanifest in that dir.Notes
I think, both proposed solutions are fine and can be implemented concurrently and without interfering each other.
Related: #6126