mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-01 20:31:12 +00:00
Use fs_err in more places (#926)
Before: ``` error: Failed to download distributions Caused by: Failed to fetch wheel: jaxlib==0.4.23+cuda12.cudnn89 Caused by: Directory not empty (os error 39) ``` After: ``` error: Failed to download distributions Caused by: Failed to fetch wheel: jaxlib==0.4.23+cuda12.cudnn89 Caused by: failed to rename file from /home/konsti/.cache/puffin/.tmpcG7tVP/jaxlib-0.4.23+cuda12.cudnn89-cp310-cp310-manylinux2014_x86_64.whl to /home/konsti/.cache/puffin/wheels-v0/index/9ff50b883297fa9d/jaxlib/jaxlib-0.4.23+cuda12.cudnn89-cp310-cp310-manylinux2014_x86_64 Caused by: Directory not empty (os error 39) ```
This commit is contained in:
parent
05029d219f
commit
95f3cca28d
4 changed files with 8 additions and 8 deletions
|
|
@ -159,7 +159,7 @@ impl<'a, Context: BuildContext + Send + Sync> DistributionDatabase<'a, Context>
|
||||||
);
|
);
|
||||||
fs::create_dir_all(&cache_entry.dir()).await?;
|
fs::create_dir_all(&cache_entry.dir()).await?;
|
||||||
let target = cache_entry.into_path_buf();
|
let target = cache_entry.into_path_buf();
|
||||||
tokio::fs::rename(temp_target, &target).await?;
|
fs_err::tokio::rename(temp_target, &target).await?;
|
||||||
|
|
||||||
Ok(LocalWheel::Unzipped(UnzippedWheel {
|
Ok(LocalWheel::Unzipped(UnzippedWheel {
|
||||||
dist: dist.clone(),
|
dist: dist.clone(),
|
||||||
|
|
@ -184,7 +184,7 @@ impl<'a, Context: BuildContext + Send + Sync> DistributionDatabase<'a, Context>
|
||||||
);
|
);
|
||||||
fs::create_dir_all(&cache_entry.dir()).await?;
|
fs::create_dir_all(&cache_entry.dir()).await?;
|
||||||
let target = cache_entry.into_path_buf();
|
let target = cache_entry.into_path_buf();
|
||||||
tokio::fs::rename(temp_target, &target).await?;
|
fs_err::tokio::rename(temp_target, &target).await?;
|
||||||
|
|
||||||
let local_wheel = LocalWheel::Unzipped(UnzippedWheel {
|
let local_wheel = LocalWheel::Unzipped(UnzippedWheel {
|
||||||
dist: dist.clone(),
|
dist: dist.clone(),
|
||||||
|
|
|
||||||
|
|
@ -834,7 +834,7 @@ impl<'a, T: BuildContext> SourceDistCachedBuilder<'a, T> {
|
||||||
// Download the source distribution to a temporary file.
|
// Download the source distribution to a temporary file.
|
||||||
let sdist_file = temp_dir.path().join(source_dist_filename);
|
let sdist_file = temp_dir.path().join(source_dist_filename);
|
||||||
let mut writer = tokio::io::BufWriter::new(
|
let mut writer = tokio::io::BufWriter::new(
|
||||||
tokio::fs::File::create(&sdist_file)
|
fs_err::tokio::File::create(&sdist_file)
|
||||||
.await
|
.await
|
||||||
.map_err(puffin_client::Error::CacheWrite)?,
|
.map_err(puffin_client::Error::CacheWrite)?,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@ workspace = true
|
||||||
tokio-util = { workspace = true, features = ["compat"] }
|
tokio-util = { workspace = true, features = ["compat"] }
|
||||||
async_zip = { workspace = true, features = ["tokio"] }
|
async_zip = { workspace = true, features = ["tokio"] }
|
||||||
flate2 = { workspace = true }
|
flate2 = { workspace = true }
|
||||||
fs-err = { workspace = true }
|
fs-err = { workspace = true, features = ["tokio"] }
|
||||||
rayon = { workspace = true }
|
rayon = { workspace = true }
|
||||||
tar = { workspace = true }
|
tar = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true, features = ["io-util"] }
|
||||||
zip = { workspace = true }
|
zip = { workspace = true }
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,12 @@ pub async fn unzip_no_seek<R: tokio::io::AsyncRead + Unpin>(
|
||||||
|
|
||||||
// Create dir or write file
|
// Create dir or write file
|
||||||
if is_dir {
|
if is_dir {
|
||||||
tokio::fs::create_dir_all(path).await?;
|
fs_err::tokio::create_dir_all(path).await?;
|
||||||
} else {
|
} else {
|
||||||
if let Some(parent) = path.parent() {
|
if let Some(parent) = path.parent() {
|
||||||
tokio::fs::create_dir_all(parent).await?;
|
fs_err::tokio::create_dir_all(parent).await?;
|
||||||
}
|
}
|
||||||
let file = tokio::fs::File::create(path).await?;
|
let file = fs_err::tokio::File::create(path).await?;
|
||||||
let mut writer = tokio::io::BufWriter::new(file);
|
let mut writer = tokio::io::BufWriter::new(file);
|
||||||
let mut reader = entry.reader_mut().compat();
|
let mut reader = entry.reader_mut().compat();
|
||||||
tokio::io::copy(&mut reader, &mut writer).await?;
|
tokio::io::copy(&mut reader, &mut writer).await?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue