From 011a6de6dc1a49a4a6e816d8c5df39800a362879 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 19 Mar 2025 10:15:12 -0700 Subject: [PATCH] Make deserialization non-fatal when assessing source tree revisions (#12319) ## Summary Closes https://github.com/astral-sh/uv/issues/12318. --- crates/uv-distribution/src/source/mod.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/uv-distribution/src/source/mod.rs b/crates/uv-distribution/src/source/mod.rs index a09b7a8e3..f2448590b 100644 --- a/crates/uv-distribution/src/source/mod.rs +++ b/crates/uv-distribution/src/source/mod.rs @@ -1363,9 +1363,17 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { .map_err(Error::CacheRead)? .is_fresh() { - if let Some(pointer) = LocalRevisionPointer::read_from(&entry)? { - if *pointer.cache_info() == cache_info { - return Ok(pointer); + match LocalRevisionPointer::read_from(&entry) { + Ok(Some(pointer)) => { + if *pointer.cache_info() == cache_info { + return Ok(pointer); + } + + debug!("Cached revision does not match expected cache info for: {source}"); + } + Ok(None) => {} + Err(err) => { + debug!("Failed to deserialize cached revision for: {source} ({err})",); } } }