Git dependency with a path into a sub-folder location #11858
Labels
A-crate-dependencies
Area: [dependencies] of any kind
A-git
Area: anything dealing with git
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-triage
Status: This issue is waiting on initial triage.
Problem
I would like to depend on Hashicorp's
nomad_client
, provided as a Git dependency here: https://github.com/hashicorp/nomad-openapi/blob/main/clients/rust/reqwest/v1/Cargo.tomlThe trouble is, Cargo is unable to resolve this dependency reliably, because the repository contains multiple crates named
nomad_client
:Today, Cargo happens to select the
nomad_client
crate that I want, but that could change if the order of traversal changes. (In fact, I think this ambiguity should be a hard error.)Proposed Solution
If I were able to specify the specific subtree, I would be able to reliably tell Cargo which of the two
nomad_client
crates to import.Notes
Hashicorp's own instructions suggest copying the client library into my project, and using a
path
dependency. This works, but it makes dependency updates much more complicated.This proposal is similar to #1462. However, the solution in that issue requires that the crate name be unique within the repository. That's not the case here.
Obviously, the Right Answer is for Hashicorp to fix the crate names and ideally even to publish them to Crates.io. I've proposed that here, but I'd like to move forwards while I wait for a response.
The text was updated successfully, but these errors were encountered: