From 5c414c02ca3c011834f8dab40d428889b2f969ca Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Tue, 26 Nov 2024 20:10:53 +0000 Subject: [PATCH 1/2] don't link to abi3 dll on windows for free-threaded build --- pyo3-build-config/src/impl_.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pyo3-build-config/src/impl_.rs b/pyo3-build-config/src/impl_.rs index 4e5d3c10656..4f1581820d7 100644 --- a/pyo3-build-config/src/impl_.rs +++ b/pyo3-build-config/src/impl_.rs @@ -1653,7 +1653,7 @@ fn default_lib_name_windows( // CPython bug: linking against python3_d.dll raises error // https://github.com/python/cpython/issues/101614 Ok(format!("python{}{}_d", version.major, version.minor)) - } else if abi3 && !(implementation.is_pypy() || implementation.is_graalpy()) { + } else if abi3 && !(gil_disabled || implementation.is_pypy() || implementation.is_graalpy()) { if debug { Ok(WINDOWS_ABI3_DEBUG_LIB_NAME.to_owned()) } else { @@ -2548,6 +2548,21 @@ mod tests { .unwrap(), "python313t", ); + assert_eq!( + super::default_lib_name_windows( + PythonVersion { + major: 3, + minor: 13 + }, + CPython, + true, // abi3 true should not affect the free-threaded lib name + false, + false, + true, + ) + .unwrap(), + "python313t", + ); assert_eq!( super::default_lib_name_windows( PythonVersion { From 1bd1dbbe3e69d53905ee069675616b1302f9a52d Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Fri, 29 Nov 2024 11:55:46 +0000 Subject: [PATCH 2/2] newsfragment --- newsfragments/4733.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/4733.fixed.md diff --git a/newsfragments/4733.fixed.md b/newsfragments/4733.fixed.md new file mode 100644 index 00000000000..bcf3dbad823 --- /dev/null +++ b/newsfragments/4733.fixed.md @@ -0,0 +1 @@ +Fix unresolved symbol link failures (due to linking to wrong DLL) when compiling for Python 3.13t with `abi3` features enabled.