Store source distribution directly in the cache (#1116)

I want to move towards using the archive bucket exclusively for wheels.
We never overwrite source distributions, so there's no need to symlink
them.
This commit is contained in:
Charlie Marsh 2024-01-25 17:52:31 -08:00 committed by GitHub
parent 77351c7874
commit 67b41427cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -766,9 +766,11 @@ impl<'a, T: BuildContext> SourceDistCachedBuilder<'a, T> {
drop(span);
// Persist the unzipped distribution to the cache.
self.build_context
.cache()
.persist(source_dist_dir, cache_path)
fs_err::tokio::create_dir_all(cache_path.parent().expect("Cache entry to have parent"))
.await
.map_err(Error::CacheWrite)?;
fs_err::tokio::rename(&source_dist_dir, &cache_path)
.await
.map_err(Error::CacheWrite)?;
Ok(cache_path)