-
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
Update precise in offline mode #9248
Comments
I'd like to help with this. Initial thoughts are that it should work for anything that has been cached previously. The |
Adding additional test for updating against changed offline dependancies. rust-lang#9248
I'd agree that this is a bug and I believe your thinking is correct @Revantus. Most likely there's some path in Cargo that's too eagerly returning an error when it shouldn't be, and the fix is probably just to remove the eager error or move it around. |
@ehuss I replaced it there in my branch with logic to allow it when precise is specified. I also wrote up a test for it as well that passes. The During testing I found that update does not respect source replacement during the initial resolutions. If a source pointing at crates.io is replaced with something else and that version doesn't exist/ isn't cached, the new source will point at crates.io internally and not get that replacement. This leads it to search for candidates in crates.io during the error resolution, since the filesystem registry wasn't taken into account. The |
Sorry, I'm a bit confused by the discussion of source replacement. |
It mostly just comes down to the resolution errors clarity for finding candidates in the case of missing dependencies. Build commands will still respect the source replacement so I don't see a security concern but I can see it causing extra confusion if the original source does have that dependency/version and lists it as a candidate. |
The following behavior was surprising to me:
It seems to me that Cargo should already have all the information locally to perform the last update to 1.0.123 entirely offline. Why is network access required for that update?
As a workaround, editing an
"=1.0.123"
dependency into the Cargo.toml and using offline build commands (cargo check --offline
) appears to perform that same update offline successfully.Cargo version: most recent nightly -- cargo 1.52.0-nightly (c68432f 2021-03-02)
The text was updated successfully, but these errors were encountered: