-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cargo clain git dependencies are different, when different, but still uniquely identifiable substring is used #14976
Comments
I'm going to transfer this to the cargo issue tracker, as this looks like a cargo concern. @rustbot transfer cargo |
Mind sharing a minimal reproducible example? It is not clear what the "same build tree" means. It might be a reexport issue though. |
this is pruned output of
The two lines was from Simplified example would be: crate d2 (commit hash struct Whaever; crate d1 (commit hash: d2 = { rev = "12345", git = "https://gitlab.com/.../d2" } fn eat(whatever: d2::Whaever) {} crate binary: d1 = { rev = "aaaaaaaaa", git = "https://gitlab.com/.../d1" }
d2 = { rev = "123456", git = "https://gitlab.com/.../d2" } let whatever = d2::Whaever;
d1::eat(whatever); because the @weihanglo is this explanation good enough, or do I need to create 3 public git repositories to showcase this? |
Ah! I didn't notice your original post already has a difference between Cargo sees them as from different sources. For myself I recommend using the full hash. Not only because it is unambiguous and helps unify Git sources, internally Cargo leverages it to speedup fetches on GitHub. (I understand you're using GitLab and may not benefit from it though) Anyway, thanks for the example. I'll close this and in favor of #7497. If there is a reason keeping this open separately, please let us know. |
Sure thank you, I did not find that one, when looking if it already exist, because it seems like mine being only 1 special case while #7497 is way more general. |
BTW, if you heavily use GitLab and happen to know a similar git-fetch fast path for GitLab, please share and we could perhaps implement it! |
I almost never use it from console, so I have no idea, and I consider all repositories I use to be relatively small. |
I tried this code (2 different
Cargo.toml
that are part of same build tree):I expected to see this happen: Build OK, because both refer to same version, and both use same local folder
C:\Users\xxxku\.cargo\git\checkouts\rust-libraries-d71f37936ba3494c\91a9791\
Instead, this happened:
mismatched types
between these two same versionsMeta
rustc --version --verbose
:If the error message would contain any indication, why they are different, I would consider this a minor issue, but like this the error message claim they are different, and same at same time, so apart from actually resolving them correctly to same type, if another part of the build chain considers them to be same, because they are in same folder/file.
The text was updated successfully, but these errors were encountered: