-
Notifications
You must be signed in to change notification settings - Fork 761
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
UNSAFE_PYO3_BUILD_FREE_THREADED not checked in 0.22.5 #4682
Comments
Hmm, I guess the lack of testing for this functionality might have been a problem. It looks like the logic inside of
|
Ah I see, I guess it just never worked at all on the 0.22 branch? And I never put two and two together when I first started working on this that I should have been seeing build errors. The following patch to the 0.22 branch fixes the issue: ± git diff
diff --git a/pyo3-build-config/src/impl_.rs b/pyo3-build-config/src/impl_.rs
index 674691b2..016d79fa 100644
--- a/pyo3-build-config/src/impl_.rs
+++ b/pyo3-build-config/src/impl_.rs
@@ -996,6 +996,7 @@ pub enum BuildFlag {
Py_DEBUG,
Py_REF_DEBUG,
Py_TRACE_REFS,
+ Py_GIL_DISABLED,
COUNT_ALLOCS,
Other(String),
}
@@ -1040,10 +1041,11 @@ impl FromStr for BuildFlag {
pub struct BuildFlags(pub HashSet<BuildFlag>);
impl BuildFlags {
- const ALL: [BuildFlag; 4] = [
+ const ALL: [BuildFlag; 5] = [
BuildFlag::Py_DEBUG,
BuildFlag::Py_REF_DEBUG,
BuildFlag::Py_TRACE_REFS,
+ BuildFlag::Py_GIL_DISABLED,
BuildFlag::COUNT_ALLOCS,
]; Given the impending release of 0.23, I'm not sure what we want to do. I guess another 0.22 release that fixes this is probably needed to fix the runtime segfaults while the ecosystem transitions to 0.23? |
🤦 I think I must have broken this in the backport. @ngoldbaum the problem is that I didn't want to change the |
Fixed in #4684 |
Bug Description
My understanding of #4327 is that build is supposed to fail on free-threaded Python without
UNSAFE_PYO3_BUILD_FREE_THREADED=1
since 0.22.2, but leaving this unset, 0.22.5 completes a broken free-threaded install instead of failing with the intended error.If I change Cargo.toml from:
to
I do get the expected error:
Maybe a missing backport or something?
Steps to Reproduce
mamba create -n 313t python-freethreading python=3.13
python3 -m pip install -v --no-cache rpds-py
python3 -c 'import rpds'
It will complete installation and segfault on import. Expected build to fail.
Backtrace
Your operating system and version
macOS 15.0.1 (ARM M1)
Your Python version (
python --version
)Python 3.13.0
Your Rust version (
rustc --version
)rustc 1.82.0 (f6e511eec 2024-10-15) (Homebrew)
Your PyO3 version
0.22.5
How did you install python? Did you use a virtualenv?
Additional Info
No response
The text was updated successfully, but these errors were encountered: