Skip to content

Commit

Permalink
Bump the wheel and sdist cache versions (#7560)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
charliermarsh authored Sep 19, 2024
1 parent 18c18b8 commit 5de6d23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions crates/uv-cache/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/tests/cache_prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
"###);
Expand Down

0 comments on commit 5de6d23

Please sign in to comment.