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

Open
VorpalBlade opened this issue Aug 13, 2023 · 9 comments

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?

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

No branches or pull requests

8 participants