-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
If rev is added to git url cargo gives no warnings and has unexpected behavior #8241
Comments
I think the |
Thanks didn't know this but still wired this isn't specified in the documentation. |
Is the |
I can see how that's confusing. It's actually not a github thing, it's a Cargo thing. When Cargo displays a "git source", it displays it in a short format with a hash anchor. I'm actually not sure how Cargo should deal with that. Some options off the top of my head:
|
I think this is the best option because i guess setting the ref also change other things beside the hash in the URL and because setting the ref is what you are supposed to do.
Doesn't help the user fixing what they are trying to-do. For example i wanted to add a ref and saw that the cargo output shows the ref in the url so i try to do the same thing, not really helpful if it just gets ignored because now i have to google for a solution.
Works but because i guess it also changes other things beside the url hash it will lead new users to believe that this is how git works. |
We discussed this in today's Cargo meeting, and came to the conclusion that we should notice URLs with fragments in them, warn, and in the warning tell people "if you were trying to specify a specific git revision, use We'd welcome an implementation of that logic. |
can i give making this a try i'm still very new to rust and this would be a nice way to learn a bit more about rust? |
@mjarkk Yes, go for it. Feel free to ask here or on discord if we can help! |
I've created a mr to try to fix this #8297 |
Update cargo 9 commits in 9fcb8c1d20c17f51054f7aa4e08ff28d381fe096..40ebd52206e25c7a576ee42c137cc06a745a167a 2020-05-25 16:25:36 +0000 to 2020-06-01 22:35:00 +0000 - Warn if using hash in git URL, Fixes rust-lang/cargo#8241 (rust-lang/cargo#8297) - reset lockfile information between resolutions (rust-lang/cargo#8274) - Disable strip_works test on macos. (rust-lang/cargo#8301) - Fix typo in impl Display for Strip (rust-lang/cargo#8299) - Add support for rustdoc root URL mappings. (rust-lang/cargo#8287) - Fix tests with enoent error message on non-english systems. (rust-lang/cargo#8295) - Fix fingerprinting for lld on Windows with dylib. (rust-lang/cargo#8290) - Fix a typo (rust-lang/cargo#8289) - Fix several issues with close_output test. (rust-lang/cargo#8286)
Problem
I have 2 git repos in my
Cargo.toml
:When cargo downloads / compiles these packages it shows the
#91a33539
2 times:Steps
cargo init
cargo build
Possible Solution(s)
Show an error with a note to add
rev = ".."
to the dep or support adding a rev to the URLNotes
Output of
rustup show
:The text was updated successfully, but these errors were encountered: