-
Notifications
You must be signed in to change notification settings - Fork 677
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
Fail before calling Py_Initialize
on PyPy
.
#4042
Comments
Labelling as good first issue because I think this is a relatively localised change which will help avoid a nasty crash for unsuspecting users. |
I'd be happy to take a look at these, and have recently acquainted myself a few of the relevant areas of the code. Where I am unsure is how to test this. What kind of an overall environment would be needed for this? I assume that Pyo3 uses the Python version based on the link libraries available/specified not the interactive python binary selected. I also assume there is no difference between libraries and binaries using embedded python. |
I am sorry for the slow reply here. I also got asked about this by someone at the PyCon sprints today and realised as we looked at the OP together that whatever I stated about adding |
Hey, don't worry, we're all doing this in our spare time, and thanks for the reply. |
At the moment
PyPy
does export aPy_Initialize
symbol, which in theory we allow linking against and calling. But this is just a stub and calling it segfaults. There's an upstream issue at pypy/pypy#3836 to implement support (and I once offered, but since ran out of available time to invest in such a project at present).Given that users can at the moment easily build PyO3 binaries with PyPy which immediately segfault, we should either:
Py_Initialize
on PyPy, orprepare_freethreaded_python
, and if theauto-initialize
feature is enabled, maybe fail as part of thebuild.rs
build script.The text was updated successfully, but these errors were encountered: