mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-17 02:52:45 +00:00
Add dedicated cache method for creating build directories (#8910)
## Summary Based on feedback from https://github.com/astral-sh/uv/pull/8905/files#r1833531812.
This commit is contained in:
parent
88033610b5
commit
9cd51c8a57
5 changed files with 18 additions and 12 deletions
|
|
@ -1720,10 +1720,10 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
|||
}
|
||||
|
||||
// Build into a temporary directory, to prevent partial builds.
|
||||
let build = self
|
||||
let temp_dir = self
|
||||
.build_context
|
||||
.cache()
|
||||
.environment()
|
||||
.build_dir()
|
||||
.map_err(Error::CacheWrite)?;
|
||||
|
||||
// Build the wheel.
|
||||
|
|
@ -1748,13 +1748,13 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
|||
)
|
||||
.await
|
||||
.map_err(Error::Build)?
|
||||
.wheel(build.path())
|
||||
.wheel(temp_dir.path())
|
||||
.await
|
||||
.map_err(Error::Build)?;
|
||||
|
||||
// Move the wheel to the cache.
|
||||
rename_with_retry(
|
||||
build.path().join(&disk_filename),
|
||||
temp_dir.path().join(&disk_filename),
|
||||
cache_shard.join(&disk_filename),
|
||||
)
|
||||
.await
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue