Update preview installation of Python executables to be non-fatal (#14612)
Previously, if installation of executables into the bin directory failed we'd with a non-zero code. However, if we make this behavior the default we don't want it to be fatal. There's a `--bin` opt-in to _require_ successful executable installation and a `--no-bin` opt-out to silence the warning / opt-out of installation entirely. Part of https://github.com/astral-sh/uv/issues/14296 — we need this before we can stabilize the behavior. In #14614 we do the same for writing entries to the Windows registry.
This commit is contained in:
@@ -129,12 +129,13 @@ fn read_registry_entry(company: &str, tag: &str, tag_key: &Key) -> Option<Window
|
||||
pub enum ManagedPep514Error {
|
||||
#[error("Windows has an unknown pointer width for arch: `{_0}`")]
|
||||
InvalidPointerSize(Arch),
|
||||
#[error("Failed to write registry entry: {0}")]
|
||||
WriteError(#[from] windows_result::Error),
|
||||
}
|
||||
|
||||
/// Register a managed Python installation in the Windows registry following PEP 514.
|
||||
pub fn create_registry_entry(
|
||||
installation: &ManagedPythonInstallation,
|
||||
errors: &mut Vec<(PythonInstallationKey, anyhow::Error)>,
|
||||
) -> Result<(), ManagedPep514Error> {
|
||||
let pointer_width = match installation.key().arch().family().pointer_width() {
|
||||
Ok(PointerWidth::U32) => 32,
|
||||
@@ -146,9 +147,7 @@ pub fn create_registry_entry(
|
||||
}
|
||||
};
|
||||
|
||||
if let Err(err) = write_registry_entry(installation, pointer_width) {
|
||||
errors.push((installation.key().clone(), err.into()));
|
||||
}
|
||||
write_registry_entry(installation, pointer_width)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user