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

Build on Windows fails to select a version of libc for package test #73

Closed
MauriceKayser opened this issue Oct 18, 2021 · 2 comments
Closed

Comments

@MauriceKayser
Copy link

Creating a new binary project, removing the content of main.rs, adding [unstable] build-std = ["core"] to .cargo/config.toml, and running cargo build --target x86_64-pc-windows-msvc on my Windows x64 machine returns the following error:

error: failed to select a version for the requirement `libc = "^0.2"`
candidate versions found which didn't match: 0.2.100, 0.2.99, 0.2.98, ...
location searched: crates.io index
required by package `test v0.0.0 (%UserProfile%\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\test)`

I checked the contents of %UserProfile%\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\test\Cargo.toml, it has the following dependency line: libc = { version = "0.2", default-features = false }.

Rust version: rustc 1.58.0-nightly (1f12ac872 2021-10-17)

@ehuss
Copy link
Contributor

ehuss commented Oct 18, 2021

Thanks for the report! This as also reported at rust-lang/cargo#9976, and we have identified the cause and have a fix in the works.

As a workaround, I would recommend deleting your registry cache which is located at $CARGO_HOME/registry/index. An alternate workaround is to use a nightly before nightly-2021-10-14.

@ehuss ehuss closed this as completed Oct 18, 2021
@MauriceKayser
Copy link
Author

Thanks! I did not know the correct search keywords to find the ticket you mentioned, my searching skills need improvement :^)

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

2 participants