-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Wheels built for the Python limited API on Windows should link against python3.dll, not minor version specific library like python39.dll #13167
Comments
meson/mesonbuild/modules/python.py Lines 202 to 206 in c730807
From your log:
Apparently that assumption was incorrect. :) /cc @amcn @rgommers might be interested in this as well... |
I'm investigating this presently. |
The assumption being that the At least Clang-cl and the Intel compilers also define |
I was able to reproduce locally and I have a fix, which I am currently testing against the CI workflows in the above linked PR. It currently moves a lot of code around, but I hope to refine it to a smaller patch with feedback and test results. |
Based on the example in GH issue mesonbuild#13167, the limited API test has been extended with a test to load the compiled module to ensure it can be loaded correctly.
This commit fixes GH issue mesonbuild#13167 by linking to the correct library under MINGW when the 'limited_api' kwarg is specified.
This commit fixes GH issue mesonbuild#13167 by linking to the correct library under MINGW when the 'limited_api' kwarg is specified.
Based on the example in GH issue mesonbuild#13167, the limited API test has been extended with a test to load the compiled module to ensure it can be loaded correctly.
This commit fixes GH issue mesonbuild#13167 by linking to the correct library under MINGW when the 'limited_api' kwarg is specified.
Based on the example in GH issue mesonbuild#13167, the limited API test has been extended with a test to load the compiled module to ensure it can be loaded correctly.
This commit fixes GH issue mesonbuild#13167 by linking to the correct library under MINGW when the 'limited_api' kwarg is specified.
Based on the example in GH issue mesonbuild#13167, the limited API test has been extended with a test to load the compiled module to ensure it can be loaded correctly.
This commit fixes GH issue mesonbuild#13167 by linking to the correct library under MINGW when the 'limited_api' kwarg is specified.
Based on the example in GH issue mesonbuild#13167, the limited API test has been extended with a test to load the compiled module to ensure it can be loaded correctly.
This commit fixes GH issue mesonbuild#13167 by linking to the correct library under MINGW when the 'limited_api' kwarg is specified.
Describe the bug
According to the Python C API reference manual:
However, on Windows, Meson incorrectly links against the version-specific library when building limited API extensions in limited API Python packages. As a result, the packages are broken and cannot be used with Python versions that are newer than the version used at build time.
To Reproduce
See https://github.com/lpsinger/meson-windows-limited-api. Take a look at a recent GitHub Actions workflow log such as https://github.com/lpsinger/meson-windows-limited-api/actions/runs/8918072559/job/24492117501. Notice that when cibuildwheel gets to cp310-win_amd64, it does notice the limited API wheel that it had already built with Python 3.9, as expected:
Then when it runs the unit tests, they fail with this error:
Take a look at one of the recent build artifacts containing the built packages, such as https://github.com/lpsinger/meson-windows-limited-api/actions/runs/8918072559/artifacts/1465707788.
If you unpack the wheel and look inside it, you can see that the C extension module
example.pyd
was linked against the wrong python DLL:Expected behavior
This Python C extension module should be linked against python3.dll, not python39.dll. The module should be importable and the tests should pass under Python 3.9, 3.10, 3.11, 3.12, etc.
system parameters
meson --version
1.4.0ninja --version
if it's a Ninja build 1.11.1.1The text was updated successfully, but these errors were encountered: