I just set up Rust on a new machine with rustup, in order to compile/update some older projects. However, when I try to cargo build, I'm met with this:
This got me a little further! Though it's still not quite behaving:
$ cargo build
Updating crates.io index
error: no matching package named `getrandom` found
location searched: registry `crates-io`
required by package `uscsi v0.1.0 (/home/ash/src/uscsi)`
The crate does exist though, and the same Cargo.toml works on PC, so I'm still unsure the pack actually worked correctly.
I have ~/.cargo/registry/index/github.com-b420f105fcaca6de/, which is empty aside from .git and .last-updated. There's no remote or anything set up in git, just a master branch with no commits.
It sounds like git is not doing what it should, is there a way to know what the underlying git command is so I can run it and check for output?
The actual registry can be found at GitHub - rust-lang/crates.io-index: Registry index for crates.io. I believe it does git fetch --force --update-head-ok https://github.com/rust-lang/crates.io-index/ +HEAD:refs/remotes/origin/HEAD on updates, but I'm not really sure how it actually does the init clone. You can try removing ~/.cargo/registry/index/github.com-b420f105fcaca6de/. Maybe the git cli gets confused by leftovers from the failed libgit2 clone operation?
I've been removing it between failures, so I know it's not that.
I took a little look with strace and can see that the last thing it does before giving the error is.. open and read a pack file, just like in the original post. I'm starting to think this might be a bug in libgit2 related to parsing pack files (maybe because I'm on big-endian?).. should I try nightly and file a bug report?