Use atomic writes for the cache consistently (#546)

Ensure we're using atomic writes everywhere in our cache to avoid broken
cache records and error with parallel puffin actions
(https://github.com/astral-sh/puffin/pull/544#issuecomment-1838841581).

All json files that are written to the cache are written atomically and
the build wheels are written to temp dir and then moved atomically. I
didn't touch venv creation though, i don't think that's worth it since
python does not support atomic package installation through its design.
This commit is contained in:
konsti 2023-12-04 18:02:01 +01:00 committed by GitHub
parent e9c9e9718e
commit d5abd33813
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 69 additions and 36 deletions

View file

@ -88,10 +88,6 @@ fn venv_impl(
)
.into_diagnostic()?;
// If the path already exists, remove it.
fs::remove_file(path).ok();
fs::remove_dir_all(path).ok();
writeln!(
printer,
"Creating virtual environment at: {}",