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()