-
Notifications
You must be signed in to change notification settings - Fork 766
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
Fix windows free-threaded build issues #4690
Conversation
With this the pytests pass on my Windows dev machine. I just need to fix up the clippy warnings and add Windows CI and this should be ready. |
), | ||
"python3.7md", | ||
); | ||
|
||
// PyPy 3.9 includes ldversion | ||
assert_eq!( | ||
super::default_lib_name_unix(PythonVersion { major: 3, minor: 9 }, PyPy, None), | ||
super::default_lib_name_unix(PythonVersion { major: 3, minor: 9 }, PyPy, None, false), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to flesh out these tests now that we support the free-threaded build. I ran out of steam this week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough; some tidying for post-0.23 perhaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, this looks good to me; thanks very much! Just one small suggestion.
pyo3-build-config/src/impl_.rs
Outdated
let script = String::from("import sys;print(sys.version_info < (3, 13))"); | ||
let stdout = run_python_script(interpreter.as_ref(), &script)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's please move this inside the if cfg!(windows)
block? Otherwise we launch an extra Python interpreter run on every build :)
Fixes #4685.
This fixes a number of issues in the free-threaded build on Windows.
Before, we were linking
libpython313.dll
but we really wantedlibpython313t.dll
. This is the correct thing to do on all platforms so I also updated the build config to always look for a dynamic library with thet
suffix. This may matter for packaging on Linux distros, depending on how they decide to package the free-threaded build.It also updates the logic to get sysconfig data from the interpreter at build time on Windows. Before, we always ignored the sysconfigdata because it was never populated, but as of 3.13 this has been fixed, so I only return a blank sysconfig on Python < 3.13.
I also had to account for the fact that
Python.h
doesn't do#define Py_GIL_DISABLED
on windows for the ffi check.