Skip to content

Patch git dependency in a workspace or sub-directory #9624

Closed
@ratijas

Description

@ratijas

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.toml manifest in that dir.

Notes

I think, both proposed solutions are fine and can be implemented concurrently and without interfering each other.

Related: #6126

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-crate-dependenciesArea: [dependencies] of any kindA-documenting-cargo-itselfArea: Cargo's documentationC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-easyExperience: EasyS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions