mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-26 20:19:08 +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,15 +519,17 @@ 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.implementation() == ImplementationName::CPython {
|
if self.key().os.is_like_darwin() {
|
||||||
let dylib_path = self.python_dir().join("lib").join(format!(
|
if *self.implementation() == ImplementationName::CPython {
|
||||||
"{}python{}{}{}",
|
let dylib_path = self.python_dir().join("lib").join(format!(
|
||||||
std::env::consts::DLL_PREFIX,
|
"{}python{}{}{}",
|
||||||
self.key.version().python_version(),
|
std::env::consts::DLL_PREFIX,
|
||||||
self.key.variant().suffix(),
|
self.key.version().python_version(),
|
||||||
std::env::consts::DLL_SUFFIX
|
self.key.variant().suffix(),
|
||||||
));
|
std::env::consts::DLL_SUFFIX
|
||||||
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