-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Cargo should skip crates.io check with --locked and all dependencies already resolved #10984
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
Comments
This comment was marked as resolved.
This comment was marked as resolved.
1 similar comment
This comment was marked as resolved.
This comment was marked as resolved.
Transferred to the cargo repo.
It is checking if any dependencies have been yanked. I'm not sure what might be a better way to handle that. At least it could provide a better error message, to perhaps suggest using Copying the current error message:
|
|
I believe its there to report warnings. However, re-evaluating how high of fidelity the warnings have to be is reasonable. Howver, at least in my testing, the scope of performance improvement, when the network is working, is small. I did some quick tests on my machine with |
Yeah, in the happy case it's not too bad of a cost at all. The problem is the variability of the highly volatile nature of establishing network connections to third party servers as compared to all the other things that (I'm not clear on how the internals of the update check are performed, can a git gc run ever delay this as well?) |
I feel I should add that, in my evaluation, I have a high quality fiber connection and so the results could be dramatically worse for regions that will have significantly worse internet connections. |
Note: we have an unstable no-index-update feature (#7404) |
Thanks, Ed! |
Last week there was a temporary outage of crates.io and my build requests were all hanging on "Updating crates.io index" even though they were subsequent invocations of the same
cargo
command, seconds apart, with--locked
specified, e.g.If all the dependencies in
Cargo.toml
are inCargo.lock
andCargo.lock
is itself in a fully consistent state with no missing dependencies,cargo install --locked
should be equivalent tocargo install --offline --locked
(which is what I ended up using). (Please let me know if I'm missing something that cargo needs internet access for if all dependencies are present and account for.)I would also argue that there should be some sort of recency check before
cargo install
forces an update of the crates.io index, regardless of whether or not--locked
was specified. If all dependencies are present and account for and the lock file is in a consistent state and all integrity checks pass, there's no reason for to back-to-back invocations ofcargo install --path ...
to hit the crates.io server (slowing down the effective/observed compile time, generating unnecessary load on the crates.io server, and raising privacy concerns).Experienced with cargo 1.63.0-nightly (8d42b0e 2022-06-17)
@rustbot label +T-cargo +A-incr-comp +I-compiletime
The text was updated successfully, but these errors were encountered: