mirror of https://github.com/astral-sh/uv
Currently, `uv cache clean` and `uv cache prune` can cause crashes in other uv processes running in parallel by removing their in-use files. We can solve this by using a shared (read) lock on the cache directory, while the `uv cache` operations use an exclusive (write) lock. The drawback is that this is always one extra lock, and that we assume that all platforms support shared locks. Once Rust 1.89 fulfills our N-2 policy, we can add support for these methods in fs_err and switch to https://doc.rust-lang.org/std/fs/struct.File.html#platform-specific-behavior-2. **Test Plan** Open one terminal, run: ``` uv venv -c -p 3.13 UV_CACHE_DIR=cache uv cache clean UV_CACHE_DIR=cache uv pip install numpy==2.0.0 ``` Open another terminal, run: ``` UV_CACHE_DIR=cache uv cache clean ``` Fixes #15704 Part of #13883 |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||