-
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 updating index even with lockfile presence #1710
Comments
I can obviously reproduce so I'm doing digging. Just raised in case someone has immediate thoughts. |
With
I get
But
It's not changed since then, so it wouldn't be getting anything new anyway...
I'm going to do a git bisect... |
Bisect definitely identifies e5a870b as the culprit... |
I reverted just the change to source.rs, but no joy. Apparently just upgrading |
Ah! It's looking at a different registry folder.
Previously:
short hash: 1ecc6299db9ec823 Now:
short hash: 0a35038f75765ae4 I see no difference in sourceid. Has deriving PartialOrd in url changed the hash? |
I get different hash values between url version 0.2.34 and 0.2.35. |
Raised servo/rust-url#117 |
Closing, not really a cargo issue, was just annoying to hit when I had no internet. |
@aidanhs hm it should definitely not be the case that a cargo instance should continue updating after it's updated once, but it is possible for cargo to require an update across cargo versions (due to the underlying hashes change, like you found). If you keep running into this though please feel free to reopen! |
Just when I was hoping to do some rust programming offline... |
I've got two machines with this version of cargo.
One exhibits the annoying updating behaviour, one doesn't. Broken machine:
Good machine:
Good machine after nuking the cargo config
So something to do with the mismatch.
Edit: yes I've reset my API token after being an idiot and pasting it above |
Do you know of perhaps any major differences between the two machines? It looks like the logs aren't too too useful here but if I gave you a build with extra logging would you be able to repro again? |
One's inside a docker container (the broken one), the other is an actual machine. Yes, I can consistently repro. Don't worry about a build with extra logging, I'll start tracking it down when I have reliably internet again. |
OK, thanks for taking a look @aidanhs! |
|
Even though it already has libc downloaded (and compiled by the third time we do the build) it updates the index because it needs to change the Cargo.lock, due to Cargo.toml changing. |
This is a case where the stars do align (#1882 (comment)) but cargo doesn't realise. Closing in favour of that issue. |
Ok, back to the originally reported issue this time.
I've run into it again (culprit is a rust-url upgrade, like last time), and now I have two sets of registry index folders. Anything with
It seems like it might be worthwhile to take the recommendation from the rust-url issue so that the hash value doesn't keep changing:
|
That's a good point! Although I believe the |
This issue was originally raised because Url moved away from basing it on serialisation! How would you feel about me bringing the current url hash impl into cargo to make a guarantee about it staying stable? |
I'd personally prefer to stick to |
I don't think I expressed myself very well - I'll make a PR for clarity, it'll only be changing a couple of lines I think. |
Sure I guess it can't hurt to see what the changes are. |
…hton Hash url serialization to ensure hash stability `as_str` is documented to return the serialization of a url (http://servo.github.io/rust-url/url/struct.Url.html#method.as_str). The serialization of a url has a spec (https://url.spec.whatwg.org/#url-serializing). Hashing the serialization of a url insulates cargo against possible decisions to alter how rust-url does hashing (I've observed it happening twice). Note that rust-url happens to do this internally (but is not guaranteed to in future) and so this change doesn't actually have any effect on hash values. r? @alexcrichton Closes #1710
The snapshot version of cargo used for compiling cargo itself doesn't exhibit this. Not sure if it was an intentional change...
The text was updated successfully, but these errors were encountered: