From 41bb53291e2e11dd6407c4702481c8d8308d4c38 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 23 Dec 2024 16:04:28 -0500 Subject: [PATCH] Raise target-lexicon version and update for API changes (#4822) --- newsfragments/4822.changed.md | 1 + pyo3-build-config/Cargo.toml | 4 ++-- pyo3-build-config/src/impl_.rs | 4 ++-- pyo3-build-config/src/lib.rs | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 newsfragments/4822.changed.md diff --git a/newsfragments/4822.changed.md b/newsfragments/4822.changed.md new file mode 100644 index 00000000000..a06613292c4 --- /dev/null +++ b/newsfragments/4822.changed.md @@ -0,0 +1 @@ +Bumped `target-lexicon` dependency to 0.13 diff --git a/pyo3-build-config/Cargo.toml b/pyo3-build-config/Cargo.toml index 1e951b29bff..656a03d44b3 100644 --- a/pyo3-build-config/Cargo.toml +++ b/pyo3-build-config/Cargo.toml @@ -14,11 +14,11 @@ rust-version = "1.63" [dependencies] once_cell = "1" python3-dll-a = { version = "0.2.11", optional = true } -target-lexicon = "0.12.14" +target-lexicon = "0.13" [build-dependencies] python3-dll-a = { version = "0.2.11", optional = true } -target-lexicon = "0.12.14" +target-lexicon = "0.13" [features] default = [] diff --git a/pyo3-build-config/src/impl_.rs b/pyo3-build-config/src/impl_.rs index 43702eebef9..e00e0aab963 100644 --- a/pyo3-build-config/src/impl_.rs +++ b/pyo3-build-config/src/impl_.rs @@ -938,8 +938,8 @@ impl CrossCompileConfig { && host.operating_system == OperatingSystem::Windows; // Not cross-compiling to compile for x86-64 Python from macOS arm64 and vice versa - compatible |= target.operating_system == OperatingSystem::Darwin - && host.operating_system == OperatingSystem::Darwin; + compatible |= matches!(target.operating_system, OperatingSystem::Darwin(_)) + && matches!(host.operating_system, OperatingSystem::Darwin(_)); !compatible } diff --git a/pyo3-build-config/src/lib.rs b/pyo3-build-config/src/lib.rs index 195f658f39e..420b81c738b 100644 --- a/pyo3-build-config/src/lib.rs +++ b/pyo3-build-config/src/lib.rs @@ -65,7 +65,7 @@ pub fn add_extension_module_link_args() { } fn _add_extension_module_link_args(triple: &Triple, mut writer: impl std::io::Write) { - if triple.operating_system == OperatingSystem::Darwin { + if matches!(triple.operating_system, OperatingSystem::Darwin(_)) { writeln!(writer, "cargo:rustc-cdylib-link-arg=-undefined").unwrap(); writeln!(writer, "cargo:rustc-cdylib-link-arg=dynamic_lookup").unwrap(); } else if triple == &Triple::from_str("wasm32-unknown-emscripten").unwrap() {