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

Failed cargo build #5251

Closed
izzyyau opened this issue Sep 25, 2022 · 5 comments
Closed

Failed cargo build #5251

izzyyau opened this issue Sep 25, 2022 · 5 comments

Comments

@izzyyau
Copy link

izzyyau commented Sep 25, 2022

I ran "cargo build", but it gives me error:

error: failed to select a version for the requirement `libgit2-sys = "^0.14.0"`
candidate versions found which didn't match: 0.13.2+1.4.2, 0.13.1+1.4.2, 0.13.0+1.4.1, ...
location searched: crates.io index
required by package `git2 v0.15.0`
    ... which satisfies dependency `git2 = "=0.15.0"` (locked to 0.15.0) of package `cargo-registry-index v0.0.0 (/home/yiggu3/crates.io/cargo-registry-index)`
    ... which satisfies path dependency `cargo-registry-index` (locked to 0.0.0) of package `cargo-registry v0.2.2 (/home/yiggu3/crates.io)`

Is anybody have any idea to fix it?

@Eh2406
Copy link
Contributor

Eh2406 commented Sep 25, 2022

What project were you trying to build? What dependencies did it have?
What is in your lock file? Does it work if you delete your lock file?
What do you have configured in your .cargo/config files?

@izzyyau
Copy link
Author

izzyyau commented Sep 25, 2022

Hi, Thanks for your reply.
I just git clone the crates.io project, https://github.com/rust-lang/crates.io.git, on master branch, and try to build it.

At the first time, I followed the instruction listed in docs/CONTRIBUTING.md, install the required backend and frontend packages and when I cargo run it, it said "error: could not compile cargo-registry due to 348 previous errors; 21 warnings emitted"

On the second time, I tried not to install anything at first, just install rust and clang, it gives me the error like I just I posted.

I didn't change anything just git clone it.

@carols10cents
Copy link
Member

What versions of rustc and cargo do you have? (plesae paste the output of rustc -vV and cargo -vV) How did you install Rust?

@Turbo87
Copy link
Member

Turbo87 commented Oct 4, 2022

this is most likely caused by rust-lang/cargo#10623, which indicates that your Rust/cargo versions are not up-to-date. running rustup update should fix that.

@Turbo87 Turbo87 closed this as completed Oct 4, 2022
@gabrielleecredera
Copy link
Contributor

gabrielleecredera commented Oct 6, 2022

(update at the bottom)

hi, I'm seeing the same errors from @izzyyau 's comment, following the contributing docs

from rustc -vV

rustc 1.64.0 (a55dd71d5 2022-09-19)
binary: rustc
commit-hash: a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52
commit-date: 2022-09-19
host: aarch64-apple-darwin
release: 1.64.0
LLVM version: 14.0.6

from cargo -vV

cargo 1.64.0 (387270bc7 2022-09-16)
release: 1.64.0
commit-hash: 387270bc7f446d17869c7f208207c73231d6a252
commit-date: 2022-09-16
host: aarch64-apple-darwin
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.79.1 (sys:0.4.55+curl-7.83.1 system ssl:(SecureTransport) LibreSSL/3.3.6)
os: Mac OS 12.6.0 [64-bit]

both on the latest stable version

full output from cargo run
https://pastebin.com/raw/3igskWAH

update: cargo run now runs fine. Unfortunately, I have no idea what fixed it, if you're facing the same issue, try getting a fresh copy of the repo

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

5 participants