You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in here, it would be nice to allow PyO3 to fail when building against GIL-less Python. I'm planning to implement this feature so I opened this issue to track discussion regarding this issue.
I was advised to look at the pyo3-build-config crate and the following is my plan of implementation of this feature:
Add an additional boolean field (possibly named free_threaded) in InterpreterConfig to indicate whether the interpreter is free-threaded or not.
In the build.rs located at pyo3-ffi crate or the one in top-level workspace, add an additional check in configure_pyo3 to validate the interpreter is not free-threaded (from the obtained InterpreterConfig instance), and panic otherwise.
Add an additional environment variable (possibly named PYO3_ALLOW_FREE_THREADED) to override the second bullet, to facilitate building during development.
Add an additional boolean field (possibly named free_threaded) in InterpreterConfig to indicate whether the interpreter is free-threaded or not.
Depending on the CPython configuration, it might be that an additional field isn't needed and this can go into build_flags.
In the build.rs located at pyo3-ffi crate or the one in top-level workspace, add an additional check in configure_pyo3 to validate the interpreter is not free-threaded (from the obtained InterpreterConfig instance), and panic otherwise.
Yes (though configure_pyo3 returns a result rather than panicking).
Add an additional environment variable (possibly named PYO3_ALLOW_FREE_THREADED) to override the second bullet, to facilitate building during development.
Yes please, I think maybe UNSAFE_PYO3_BUILD_FREE_THREADED perhaps? We expect builds to be broken until the moment we've finalised support, so I think hinting at this in the env var might be a good idea.
As discussed in here, it would be nice to allow PyO3 to fail when building against GIL-less Python. I'm planning to implement this feature so I opened this issue to track discussion regarding this issue.
I was advised to look at the
pyo3-build-config
crate and the following is my plan of implementation of this feature:free_threaded
) inInterpreterConfig
to indicate whether the interpreter is free-threaded or not.build.rs
located atpyo3-ffi
crate or the one in top-level workspace, add an additional check inconfigure_pyo3
to validate the interpreter is not free-threaded (from the obtainedInterpreterConfig
instance), and panic otherwise.PYO3_ALLOW_FREE_THREADED
) to override the second bullet, to facilitate building during development.Any advice would be much appreciated! Thanks! :)
Related to: #4265
The text was updated successfully, but these errors were encountered: