Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #11665 - ehuss:cargo-ok-truncated, r=epage
Handle .cargo-ok being truncated This fixes an issue where if the `.cargo-ok` file is truncated then Cargo will get stuck with being unable to extract the package. Creating the `.cargo-ok` file uses `create_new` which will fail if the file exists. If the file gets created, but there is a failure to flush it, or if the filesystem otherwise gets corrupted, then the `create_new` step will fail with `File exists`. The solution here is to delete the cache directory if the `.cargo-ok` file is truncated, as there may be some uncertainty of the validity of the cache. This also adds better error handling if there is some problem opening the `.cargo-ok` file instead of ignoring errors. Closes #11638
- Loading branch information