Bump the wheel and sdist cache versions (#7560)

## Summary

Both of these can contain rkyv data in their HTTP cache envelopes. As
such, the entries aren't readable by earlier versions of uv, and `uv
cache prune` can break. I should make `uv cache prune` robust to this,
but this feels safest.
This commit is contained in:
Charlie Marsh
2024-09-19 15:53:06 -04:00
committed by GitHub
parent 18c18b8406
commit 5de6d2338d
2 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -759,15 +759,16 @@ pub enum CacheBucket {
impl CacheBucket {
fn to_str(self) -> &'static str {
match self {
// Note, next time we change the version we should change the name of this bucket to `source-dists-v0`
Self::SourceDistributions => "built-wheels-v3",
Self::SourceDistributions => "sdists-v4",
Self::FlatIndex => "flat-index-v0",
Self::Git => "git-v0",
Self::Interpreter => "interpreter-v2",
// Note that when bumping this, you'll also need to bump it
// in crates/uv/tests/cache_clean.rs.
Self::Simple => "simple-v13",
Self::Wheels => "wheels-v1",
// Note that when bumping this, you'll also need to bump it
// in crates/uv/tests/cache_prune.rs.
Self::Wheels => "wheels-v2",
Self::Archive => "archive-v0",
Self::Builds => "builds-v0",
Self::Environments => "environments-v1",
+2 -2
View File
@@ -142,7 +142,7 @@ fn prune_stale_symlink() -> Result<()> {
.success();
// Remove the wheels directory, causing the symlink to become stale.
let wheels = context.cache_dir.child("wheels-v1");
let wheels = context.cache_dir.child("wheels-v2");
fs_err::remove_dir_all(wheels)?;
let filters: Vec<_> = context
@@ -330,7 +330,7 @@ fn prune_stale_revision() -> Result<()> {
----- stderr -----
DEBUG uv [VERSION] ([COMMIT] DATE)
Pruning cache at: [CACHE_DIR]/
DEBUG Removing dangling source revision: [CACHE_DIR]/built-wheels-v3/[ENTRY]
DEBUG Removing dangling source revision: [CACHE_DIR]/sdists-v4/[ENTRY]
DEBUG Removing dangling cache archive: [CACHE_DIR]/archive-v0/[ENTRY]
Removed 8 files ([SIZE])
"###);