Closed gyscos closed 2 years ago
$ git show v0.8.0
tag v0.8.0
Tagger: nabijaczleweli <nabijaczleweli@gmail.com>
Date: Sat Mar 25 20:40:49 2017 +0100
$ git show v0.8.0:src/ops/mod.rs | wc -l
389
huh?
Ha ha nevermind turns out it was for another cargo command, cargo-install-update. Ugh I have a problem with names...
no no, this crate does provide cargo install-update
and cargo install-update-config
, but 0.8.0 is both four years old and doesn't have a line 785 in the file you mentioned
Ah yes it was 8.0.0, sorry for the typo. I suppose I got too used to sub-1 version numbers...
ah, that makes more sense (and yeah, each time I bump this I mistype it at least twice, too)
Okay, so you have a .crates.toml
file (in $HOME/.cargo
, presumably), but "index not found" probably points to the ["v1"]
index going bad (this code is literally untouched since mid-2017, when it inherited the lack of error handling from its first incarnation in 2017. let's just say it's not written defensively nor well).
Would you mind posting the file here?
I updated the top post; this file is empty on my machine.
I'm not totally sure who created this file. Maybe cargo
or rustup
on first call? In any case if I remove the file entirely, the issues disappears (since cargo install-update doesn't even try to read it).
Ah running cargo install --list
does generate this empty file (as well as .crates2.json
file, empty as well).
And sure enough it does open_rw
which I suspects creates an empty file if it doesn't exist yet.
Right. I explicitly check for no file but not for a lack of the v1
section. I'd say that this is a format violation on cargo's part, but :v
Would you mind trying the latest master
branch (at least c57e0a2d7b0f20e1284c00ed9a1344e795c92a11)?
The latest commit does indeed prevent this panic. Thanks!
Ace, released in v8.1.2
.
When no binary has been
cargo install
'ed yet (includingcargo-update
), it panics:This can happen when
cargo-update
(and possibly others) are installed system-wide rather than using cargo itself.This is using cargo-update ~0.8.0~ 8.0.0 on archlinux from the AUR: https://aur.archlinux.org/packages/cargo-update
At least the
.crates.toml
file exists (but is empty):