From 025d20973585f799a05f395d749fc3b80aaa4495 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 2 Aug 2025 14:08:49 -0400 Subject: [PATCH] Move cache sharding below `prepare_metadata_for_build_wheel` (#15029) ## Summary No change in behavior. This logic just isn't needed until the next block, and as-written, it's hard to tell. --- crates/uv-distribution/src/source/mod.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/uv-distribution/src/source/mod.rs b/crates/uv-distribution/src/source/mod.rs index 3d9361797..6e1dbb228 100644 --- a/crates/uv-distribution/src/source/mod.rs +++ b/crates/uv-distribution/src/source/mod.rs @@ -629,15 +629,6 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { } } - // If there are build settings or extra build dependencies, we need to scope to a cache shard. - let config_settings = self.config_settings_for(source.name()); - let extra_build_deps = self.extra_build_dependencies_for(source.name()); - let cache_shard = if config_settings.is_empty() && extra_build_deps.is_empty() { - cache_shard - } else { - cache_shard.shard(cache_digest(&(&config_settings, extra_build_deps))) - }; - // Otherwise, we either need to build the metadata. // If the backend supports `prepare_metadata_for_build_wheel`, use it. if let Some(metadata) = self @@ -674,6 +665,15 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { }); } + // If there are build settings or extra build dependencies, we need to scope to a cache shard. + let config_settings = self.config_settings_for(source.name()); + let extra_build_deps = self.extra_build_dependencies_for(source.name()); + let cache_shard = if config_settings.is_empty() && extra_build_deps.is_empty() { + cache_shard + } else { + cache_shard.shard(cache_digest(&(&config_settings, extra_build_deps))) + }; + let task = self .reporter .as_ref()