Skip to content

Commit 9714eab

Browse files
committed
don't link to abi3 dll on windows for free-threaded build (#4733)
* don't link to abi3 dll on windows for free-threaded build * newsfragment
1 parent a752425 commit 9714eab

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

newsfragments/4733.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix unresolved symbol link failures (due to linking to wrong DLL) when compiling for Python 3.13t with `abi3` features enabled.

pyo3-build-config/src/impl_.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ fn default_lib_name_windows(
16491649
// CPython bug: linking against python3_d.dll raises error
16501650
// https://github.com/python/cpython/issues/101614
16511651
Ok(format!("python{}{}_d", version.major, version.minor))
1652-
} else if abi3 && !(implementation.is_pypy() || implementation.is_graalpy()) {
1652+
} else if abi3 && !(gil_disabled || implementation.is_pypy() || implementation.is_graalpy()) {
16531653
if debug {
16541654
Ok(WINDOWS_ABI3_DEBUG_LIB_NAME.to_owned())
16551655
} else {
@@ -2544,6 +2544,21 @@ mod tests {
25442544
.unwrap(),
25452545
"python313t",
25462546
);
2547+
assert_eq!(
2548+
super::default_lib_name_windows(
2549+
PythonVersion {
2550+
major: 3,
2551+
minor: 13
2552+
},
2553+
CPython,
2554+
true, // abi3 true should not affect the free-threaded lib name
2555+
false,
2556+
false,
2557+
true,
2558+
)
2559+
.unwrap(),
2560+
"python313t",
2561+
);
25472562
assert_eq!(
25482563
super::default_lib_name_windows(
25492564
PythonVersion {

0 commit comments

Comments
 (0)