mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-27 04:29:10 +00:00
Avoid attempting to patch macOS dylib for non-macOS installs (#10721)
## Summary For example, `cargo run python install cpython-3.12.8-linux-x86_64_v3-gnu` (on macOS) shouldn't attempt to patch the dylib. At present, it leads to this warning: ``` warning: Failed to patch the install name of the dynamic library for /Users/crmarsh/.local/share/uv/python/cpython-3.12.8-linux-x86_64_v3-gnu/bin/python3.12. This may cause issues when building Python native extensions. Underlying error: Failed to update the install name of the Python dynamic library located at `/Users/crmarsh/.local/share/uv/python/cpython-3.12.8-linux-x86_64_v3-gnu/lib/libpython3.12.dylib` ```
This commit is contained in:
parent
08da17d035
commit
a7f67e877c
1 changed files with 11 additions and 9 deletions
|
@ -519,6 +519,7 @@ impl ManagedPythonInstallation {
|
||||||
/// See <https://github.com/astral-sh/uv/issues/10598> for more information.
|
/// See <https://github.com/astral-sh/uv/issues/10598> for more information.
|
||||||
pub fn ensure_dylib_patched(&self) -> Result<(), macos_dylib::Error> {
|
pub fn ensure_dylib_patched(&self) -> Result<(), macos_dylib::Error> {
|
||||||
if cfg!(target_os = "macos") {
|
if cfg!(target_os = "macos") {
|
||||||
|
if self.key().os.is_like_darwin() {
|
||||||
if *self.implementation() == ImplementationName::CPython {
|
if *self.implementation() == ImplementationName::CPython {
|
||||||
let dylib_path = self.python_dir().join("lib").join(format!(
|
let dylib_path = self.python_dir().join("lib").join(format!(
|
||||||
"{}python{}{}{}",
|
"{}python{}{}{}",
|
||||||
|
@ -530,6 +531,7 @@ impl ManagedPythonInstallation {
|
||||||
macos_dylib::patch_dylib_install_name(dylib_path)?;
|
macos_dylib::patch_dylib_install_name(dylib_path)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue