Retry on spurious failures when caching built wheels (#4605)

https://github.com/astral-sh/uv/pull/2419 appears to have only applied
this retry to wheels that were already downloaded (though I would have
to look more carefully to be certain). In
https://github.com/astral-sh/uv/issues/1491, we've gotten continued
reports of spurious failures on Windows and tracing reveals that we are
not applying our retry logic during the rename. I believe we're in this
code path — switching to our backoff retry should resolve the failures.
This commit is contained in:
Zanie Blue 2024-06-28 10:23:09 -04:00 committed by GitHub
parent 14564f97c2
commit f3c7de3c7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,7 +30,7 @@ use pep440_rs::Version;
use pep508_rs::PackageName;
use pypi_types::{Requirement, VerbatimParsedUrl};
use uv_configuration::{BuildKind, ConfigSettings, SetupPyStrategy};
use uv_fs::{PythonExt, Simplified};
use uv_fs::{rename_with_retry, PythonExt, Simplified};
use uv_toolchain::{Interpreter, PythonEnvironment};
use uv_types::{BuildContext, BuildIsolation, SourceBuildTrait};
@ -757,7 +757,7 @@ impl SourceBuild {
let from = tmp_dir.path().join(&filename);
let to = wheel_dir.join(&filename);
fs_err::rename(from, to)?;
rename_with_retry(from, to).await?;
Ok(filename)
} else {
if self.build_kind != BuildKind::Wheel {