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 build hangs forever on updating registry. #4346

Closed
alexispurslane opened this issue Jul 31, 2017 · 10 comments
Closed

cargo build hangs forever on updating registry. #4346

alexispurslane opened this issue Jul 31, 2017 · 10 comments

Comments

@alexispurslane
Copy link

I have a project (you can find it here: https://github.com/christopherdumas/guile-rs/tree/new-bindings) that causes cargo to hang indefinitely at "updating registry" while using 99.2% of my CPU. I have tried reinstalling cargo, updating Rust, etc. Nothing seems to change this behavior.
Here are the messages it prints before hanging:

warning: file found to be present in multiple build targets: /Users/christopherdumas/guile-rs/examples/shell.rs
    Updating registry `https://github.com/rust-lang/crates.io-index`

I left it running for a total of 6 hours at one point.
I'm running rustc 1.20.0-nightly (69c65d296 2017-06-28) and cargo 0.21.0-nightly (abf01e1ed 2017-06-25).

@alexispurslane
Copy link
Author

This is not a system-wide phenomena.

@alexcrichton
Copy link
Member

This is likely an instance of #4066 where the crate graph cannot be resolved and it's just taking cargo too long to inform the caller. I'd have to dig in though to confirm.

@alexispurslane
Copy link
Author

Is there any temporary workaround that I can use for now? It's completely stopping my progress.

@alexcrichton
Copy link
Member

Ok looks like you're hitting a combination of #4066 and #4127. Because of #4127 resolution fails and because of #4066 it'll take probably days to fail. What's happening here is that your lockfile indicates it wants libc 0.2.14 but you're trying to add a dependency on memchr (transitively at least) which requires libc 0.2.18.

You can fix this by running cargo update -p libc

@alexispurslane
Copy link
Author

Thank you, its working now!

@zoltanmaric
Copy link

For me running cargo update -p libc also hangs indefinitely. It just prints

Updating registry `https://github.com/rust-lang/crates.io-index`

and then nothing else happens. Even if I add the -v flag, that's all it says.

@zoltanmaric
Copy link

Nevermind, it seems that cargo update -p libc was just taking a long time. It would be nice to log something to indicate that something is happening, or at least start with a message saying that it will take while.

@johnfercher
Copy link

I'm having a problem like that. When cargo updates in my computer it works fine. When cargo updates inside a Docker container, it doesn't work.

I think you might implement a visual signal of how cargo is running. Like apt, pip or nuget, the user can see what's going on.

@jakelacey2012
Copy link

for me when running this I get an endless stream of this

DEBUG:cargo::core::resolver: checking if parking_lot v0.6.4 is already activated
DEBUG:cargo::core::resolver: checking if memoffset v0.2.1 is already activated
DEBUG:cargo::core::resolver: checking if scopeguard v0.3.3 is already activated
DEBUG:cargo::core::resolver: checking if rand v0.5.6 is already activated
DEBUG:cargo::core::resolver: checking if lazy_static v1.2.0 is already activated
DEBUG:cargo::core::resolver: checking if smallvec v0.6.8 is already activated
DEBUG:cargo::core::resolver: checking if crossbeam-utils v0.6.5 is already activated
DEBUG:cargo::core::resolver: checking if winapi v0.3.6 is already activated
DEBUG:cargo::core::resolver: checking if cfg-if v0.1.6 is already activated
DEBUG:cargo::core::resolver: checking if winapi v0.3.6 is already activated
DEBUG:cargo::core::registry: load/precise  registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::resolver: checking if unicode-xid v0.1.0 is already activated
DEBUG:cargo::core::registry: load/precise  registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::resolver: checking if unicode-xid v0.1.0 is already activated
DEBUG:cargo::core::registry: load/precise  registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::resolver: checking if unicode-xid v0.1.0 is already activated
DEBUG:cargo::core::registry: load/precise  registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::resolver: checking if unicode-xid v0.1.0 is already activated
DEBUG:cargo::core::registry: load/precise  registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::resolver: checking if unicode-xid v0.1.0 is already activated
DEBUG:cargo::core::registry: load/precise  registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::resolver: checking if unicode-xid v0.1.0 is already activated
DEBUG:cargo::core::registry: load/precise  registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::resolver: checking if unicode-xid v0.1.0 is already activated
DEBUG:cargo::core::registry: load/precise  registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::resolver: checking if unicode-xid v0.1.0 is already activated

repeated over and over when I run cargo install --verbose

@dreamATD
Copy link

dreamATD commented Apr 7, 2021

Change cargo source in ~/.cargo/config. This works for me.

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

6 participants