Skip to content
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 upgrade gets stuck at "Updating 'https://github.com/rust-lang/crates.io-index' index" #869

Closed
VorpalBlade opened this issue Aug 13, 2023 · 16 comments · Fixed by #907
Closed

Comments

@VorpalBlade
Copy link

VorpalBlade commented Aug 13, 2023

When I run cargo upgrade it gets stuck at Updating 'https://github.com/rust-lang/crates.io-index' index (for at least 10 minutes). cargo update is fast, as is other, built in, cargo operations.

It appears that cargo upgrade isn't using the sparse index properly, that could have something to do with it. It still seems strange it would get stuck for that long though, as I'm fast internet (150 mbit/s down) and not behind any sort of corporate proxy or similar that could interfere.

Running cargo upgrade -v doesn't provide any more info.

$ cargo --version
cargo 1.71.1 (7f1d04c00 2023-07-29)
$ cargo upgrade --version
cargo-edit-upgrade 0.12.0
@dmartin
Copy link

dmartin commented Aug 28, 2023

For anyone else who finds themselves here:

In order to use cargo-upgrade currently (on a fresh Rust install that has otherwise been using the new default sparse index protocol), it seems that you need to force usage of the git index protocol, and potentially perform an initial fetch to avoid a NotFound error like this.

CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git cargo fetch
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git cargo upgrade

@Xuanwo
Copy link

Xuanwo commented Nov 20, 2023

Maybe it's worth to be added in the README? I spent about half an hour on this 😢

I'm willing to do this if you accept.

cc current maintainer @epage for ideas.

@epage epage mentioned this issue Dec 20, 2023
ongardie added a commit to ongardie/cubicle that referenced this issue Feb 1, 2024
Ran `cargo upgrade` from cargo-edit (with workaround from
<killercup/cargo-edit#869 (comment)>)
and `cargo update`.
@lpnh
Copy link

lpnh commented Feb 5, 2024

Maybe it's worth to be added in the README? I spent about half an hour on this 😢

I'm willing to do this if you accept.

cc current maintainer @epage for ideas.

It's a good call. I spent quite a bit of time on it as well.

@intgr
Copy link

intgr commented Feb 20, 2024

Please also suggest CARGO_NET_GIT_FETCH_WITH_CLI=true for cargo fetch. The builtin git client is horribly slow (rust-lang/cargo#11014)

@VorpalBlade
Copy link
Author

Is there a reason this cargo upgrade doesn't simply switch over to sparse registry? That would solve this issue.

@azzamsa
Copy link

azzamsa commented Feb 20, 2024

CARGO_NET_GIT_FETCH_WITH_CLI=true and CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git doesn't work in my end. It still takes forever to fetch the deltas.

image

However, this solves my issue rust-lang/cargo#11014 (comment)

cd ~/.cargo/registry/index/github.com-1ecc6299db9ec823
git fetch https://github.com/rust-lang/crates.io-index refs/heads/master:refs/remotes/origin/master

@epage
Copy link
Collaborator

epage commented Feb 21, 2024

I can put time into this or I can put time into integrating this with cargo. I have opted for the latter.

@Xuanwo
Copy link

Xuanwo commented Feb 21, 2024

put time into integrating this with cargo

Seems cool!

@vext01
Copy link

vext01 commented Mar 9, 2024

I'm still hitting this issue, and forcing CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git cargo fetch takes so long.

Does anyone know of alternative crates that use the sparse registry?

@frederikhors
Copy link

Is there a reason this cargo upgrade doesn't simply switch over to sparse registry? That would solve this issue.

This is the answer. @epage, is this the way for the future right?

@epage
Copy link
Collaborator

epage commented Jun 29, 2024

Update nightly and give cargo +nightly -Zunstable-options update --breaking a try and leave feedback on the tracking issue.

For more details, see https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#update-breaking

@thewh1teagle
Copy link

Update nightly and give cargo +nightly -Zunstable-options update --breaking a try and leave feedback on the tracking issue.

For more details, see https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#update-breaking

It finally works much more faster than cargo-upgrade!
I tried it, but it doesn't respect beta semver.
See log:

cargo +nightly -Zunstable-options update --breaking
    Updating crates.io index
   Upgrading env_logger ^0.10.1 -> ^0.11.3
   Upgrading tauri ^2.0.0-beta.21 -> ^1.7.0
   Upgrading tauri-plugin-deep-link ^2.0.0-beta.5 -> ^0.1.2
   Upgrading windows ^0.56.0 -> ^0.57.0
   Upgrading reqwest ^0.11.23 -> ^0.12.5
    Updating crates.io index

@epage
Copy link
Collaborator

epage commented Jul 2, 2024

Please open an issue on the cargo repo. The work being done there will not track feedback here.

@VorpalBlade
Copy link
Author

Based on rust-lang/cargo#14204 it seems that cargo update --breaking is in fact not meant to be a replacement for cargo upgrade and there is no plan to support that either. :(

@epage
Copy link
Collaborator

epage commented Jul 6, 2024

It is the replacement we are offering. It is not a direct port but what we found works for integrating into cargo.

snev68 added a commit to snev68/cubicle that referenced this issue Aug 5, 2024
Ran `cargo upgrade` from cargo-edit (with workaround from
<killercup/cargo-edit#869 (comment)>)
and `cargo update`.
@tarka
Copy link

tarka commented Sep 17, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.