Open CryZe opened 8 years ago
Oh this is actually not the metadata in .cargo
but rather the metadata emitted by cargo install
. Could you gist the contents of .cargo/.crates.toml
?
Looks like it's 855 NUL Bytes.
Whoa that sounds... bad! I have no idea what we could do to cause it to just be a bunch of nul bytes...
Unfortunately there's not a huge amount we can do about this corrupt metadata except complain about it. The error message could probably indicate what needs to get removed, but it loses all tracking information about installed binaries from crates.
Would it be possible to write a test for that ? E.g. running cargo in debugger for N instructions and then killing it ?
If your PC crashes while cargo is compiling something, it's pretty likely that your .cargo folder is corrupted after restarting your PC and you can't compile anything anymore. This happened 2 out of 2 times my PC crashed for me.
The errors you get with the corrupted .cargo folder look like this:
Ideally cargo shouldn't ever leave its repository in a state where it can't recover from errors anymore.