Specification of the "branch = master" in Cargo.toml breaks the build #12128
Labels
A-git
Area: anything dealing with git
A-lockfile
Area: Cargo.lock issues
C-bug
Category: bug
S-needs-design
Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Problem
If we have two crates depending on some crate X being a git repository, they should have the dependency:
In both crates'
Cargo.toml
files.By default, the
master
branch is taken, according to the documentation.However, if one crates decides to explicitly mention the branch name, as in
Cargo treats these as two different
x
crates and breaks the symbol compatibility between the two crates: both crates can't work with each other any longer, since they depend on two different crates, even if this is not the case.In the
Cargo.lock
file one can observe for the first crate:And for another:
Steps
x
.x
using git and don't specify the branch name.x
using git and specify the branch name.x
is actually the same, as per the documentation, if the branch name is omitted themaster
is taken, and the actual contents are actually the same, the symbols clash and don't merge, the compatibility breaks between the first and the second crates within the same workspace.Possible Solution(s)
Either forbid the omission of the branch name or revision or somehow make it work.
Note, that the documentation says that it should work:
Notes
No response
Version
The text was updated successfully, but these errors were encountered: