-
-
Notifications
You must be signed in to change notification settings - Fork 30.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
EXT_SUFFIX inconsistent between sysconfig and distutils.sysconfig (Windows) #84006
Comments
On Windows, Python 3.7.6 and 3.8.1:
The sysconfig answer is probably wrong (the ABI-qualified extension '.cp38-win_amd64.pyd' should be preferred). |
Agreed, this should be updated. 3.7 is out of scope, I'm afraid, but 3.8 onwards should be fine. |
the PR is awaiting approval/merge |
Thanks! |
This change broke the AMD64 FreeBSD Shared 3.x buildbot: FAIL: test_EXT_SUFFIX_in_vars (test.test_sysconfig.TestSysConfig) Traceback (most recent call last):
File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_sysconfig.py", line 368, in test_EXT_SUFFIX_in_vars
self.assertEqual(vars['EXT_SUFFIX'], _imp.extension_suffixes()[0])
AssertionError: '.so' != '.cpython-310d.so'
- .so
+ .cpython-310d.so |
It also broke POWER6 AIX 3.8: Traceback (most recent call last):
File "/home/buildbot/buildarea/3.8.aixtools-aix-power6/build/Lib/test/test_sysconfig.py", line 366, in test_EXT_SUFFIX_in_vars
self.assertEqual(vars['EXT_SUFFIX'], _imp.extension_suffixes()[0])
AssertionError: '.so' != '.cpython-38d.so'
- .so
+ .cpython-38d.so |
I submitted PR 23684 to try to skip tests to fix this. I don't understand why this wasn't caught before merge, and where AIX and FREEBSD are setting EXT_SUFFIX improperly. |
I moved the new test to a separate test function and added |
On Windows - in distutils (?) did they perhaps make a change only for windows, for whatever reason. I don't have a python3.7 pr a 3.8 handy atm. Not sure what 'distutils' pip updates either - but with py36 and pip 20.2.4 and setuptools 40.6.2 I get: Python 3.6.12 (default, Sep 23 2020, 08:27:01) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.
>>> import sysconfig
>>> sysconfig.get_config_var('EXT_SUFFIX')
'.so'
>>> from distutils import sysconfig
>>> sysconfig.get_config_var('EXT_SUFFIX')
'.so' I am guessing that distutils has not updated - whatever - for AIX, FreeBSD, and perhaps others. @mattip: is the problem perhaps with distutils rather than a particular platform. I also admit, I do not know what 'EXT_SUFFIX' is suppossed to return. From past behavior I took it to mean a file 'tag' for files that are accessed using dlopen(). Is it - perhaps - that different platforms have different needs or abilities - and the error is not the platform - but the adequacy of tests to differentiate platform behavior. I am guessing now - but maybe that is why distutils has not changed AIX and FreeBSD and maybe more. |
Looking at https://github.com/python/cpython/pull/22088/files imho: the patch forced Windows behavior ("""Initialize the module as appropriate for NT""") to be equivalent to vars['SO'] - which is what the test used to compare. So, likely the change to the tests would be to have one for NT (per the comment in Lib/sysconfig.py) and the prior test set to be skipped if the platform is |
Distutils is now deprecated (see PEP-632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils. If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools |
python/cpython#84006 >>> import sysconfig >>> sysconfig.get_config_var('EXT_SUFFIX') '.pyd' >>> from distutils import sysconfig >>> sysconfig.get_config_var('EXT_SUFFIX') '.cp38-win_amd64.pyd' v2.9.2 takes from the previous, v2.9.0 from the latter. So with v2.9.2 we get ABI-less extension which we need. v2.10.1 seems to have fixed this, but we cannot move to it (it deprecates VS2015)...
On Windows, sysconfig does not define SOABI as config var, so we parse SOABI from EXT_SUFFIX. But also Windows, EXT_SUFFIX is simply '.pyd' for Python <= 3.9, while sysconfig from distutils did define EXT_SUFFIX as '.cp39-win_amd64.pyd' as expected [1]. So on Windows and only if Python <= 3.9, get EXT_SUFFIX from distutils.sysconfig. In all other cases, keep getting it from sysconfig, as distutils was deprecated in Python 3.10 and removed in Python 3.12 [2]. [1] python/cpython#84006 [2] https://docs.python.org/3.10/whatsnew/3.10.html#distutils
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: