Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't link to abi3 dll on windows for free-threaded build #4733

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/4733.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix unresolved symbol link failures (due to linking to wrong DLL) when compiling for Python 3.13t with `abi3` features enabled.
17 changes: 16 additions & 1 deletion pyo3-build-config/src/impl_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
Loading