-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
[FindPython] Work around PyPy bug #13
Conversation
@@ -9,9 +9,20 @@ project(jarowinkler LANGUAGES C CXX) | |||
if(CMAKE_VERSION VERSION_LESS 3.18) | |||
find_package(Python COMPONENTS Interpreter Development REQUIRED) | |||
else() | |||
set(Python_ARTIFACTS_INTERACTIVE TRUE) |
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.
Not required but simpler.
@@ -11,7 +11,7 @@ function(create_cython_target _name) | |||
endfunction(create_cython_target) | |||
|
|||
create_cython_target(_initialize_cpp) | |||
Python_add_library(_initialize_cpp MODULE ${_initialize_cpp}) | |||
Python_add_library(_initialize_cpp MODULE WITH_SOABI ${_initialize_cpp}) |
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.
Only PyPy seems to care if this is missing. Maybe to avoid reading a CPython .so?
ac9b1e3
to
d330d2c
Compare
This is strange, I was sure we had ironed the issues around CMake and PyPy out a while ago. Did something change? Do you have any documentation about SONAME being the source of truth? |
In pybind11, we just use EXT_SUFFIX as the source of truth and ignore SOABI. But FindPython uses SOABI over EXT_SUFFIX; since PyPy returns an invalid SOABI, that means FindPython is broken if you add I believe the problem we fixed in 7.3.2 or something like that is SO was wrong, and pybind11 used to use that. But SOABI we didn't fix. (Unless it got fixed in a development release) https://cmake.org/cmake/help/latest/module/FindPython.html#result-variables This has been true at least since CMake 3.17 AFAICT. |
(Since you have to scroll a bit on the page, here's the relevant bit)
Not sure how I feel about Is there a quick way to grab a dev build of PyPy, like a docker image? I tried the nightly download & fought through macOS blocking every little library used, and it seems |
And this is why it works on pybind11: It was a workaround for |
Looking around for the implications of changing the |
Wheels get named correctly (and I'm guessing they will continue to be due to that PR merged in 2020), but PyPy can't open files created using the SONAME it reports - |
Fixed the SOABI in PyPY, the fix will be part of the next release. |
No, that fix broke packaging/tags, which would have broken pip and wheel, so I backed out the change. See pypa/packaging#607 |
This will be fixed in CMake 3.26 by computing the SOABI from EXT_SUFFIX. Scikit-build-core has a workaround and might even soon backport the fixed version. |
Squash & merge into your PR.
https://foss.heptapod.net/pypy/pypy/-/issues/3816 CC @mattip. SOABI is supposed to be the source of truth but PyPy gets it wrong in sysconfig (& distutils.sysconfig, which CMake claims to prefer) so we are using EXT_SUFFIX instead.