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
Using cffi to generate a wrapper for libcurl. On Windows, cffi links with -lpython312 for mingw and so the build does not work on other versions of Python.
Manually changing the -lpython312 to -lpython3 fixes the issue. I'm not sure where this command gets generated - opened issue with cffi who redirected to setuptools.
This works fine on Linux and OSX which don't need the --compiler=mingw32 flag but link with -lpython3, making the wheels generated functional with all versions of Python since 3.2.
Expected behavior
setuptools should link with -lpython3 when using --py-limited-api with mingw32.
How to Reproduce
On Windows with mingw32-x64 installed (scoop install mingw):
git clone https://github.com/genotrance/mcurl
cd mcurl
bash build.sh
Will get a wheel created which will only run on the Python version that was used to build the wheel.
Hi @genotrance , as far as I remember setuptools/ distutils do not fully support mingw yet. There is a feature request in distutils that mentions that:
@abravalheri - mingw32 works great, except for linking to the specific Python version. If I manuallly change the link command and update the wheel, it works on all Python versions. So the compile works fine, just not the link.
If this is a distutils issue, can this ticket be moved to that repo?
I believe that all the MingW discussions are happening in the pypa/distutils repository, so yeah, I think it would be better to investigate the issue there. Although I don't have the admin rights to manually transfer the issue, you might be interested in opening a new one there.
Since the py-limited-api is a setuptools and not a distutils feature I think it makes sense to keep the discussion here. Unless we make distutils optionally depend on the setuptools subclass.
setuptools version
69.0.3
Python version
3.12
OS
Windows
Additional environment information
No response
Description
Using cffi to generate a wrapper for libcurl. On Windows, cffi links with
-lpython312
for mingw and so the build does not work on other versions of Python.Manually changing the
-lpython312
to-lpython3
fixes the issue. I'm not sure where this command gets generated - opened issue with cffi who redirected to setuptools.Python build command line I used is as follows:
This works fine on Linux and OSX which don't need the
--compiler=mingw32
flag but link with-lpython3
, making the wheels generated functional with all versions of Python since 3.2.Expected behavior
setuptools should link with
-lpython3
when using--py-limited-api
with mingw32.How to Reproduce
On Windows with mingw32-x64 installed (scoop install mingw):
Will get a wheel created which will only run on the Python version that was used to build the wheel.
Output
The text was updated successfully, but these errors were encountered: