diff options
| author | Daniele Nicolodi <daniele@grinta.net> | 2022-10-27 11:02:00 +0200 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-11-23 07:29:23 -0500 |
| commit | 235f32f1a67f1d6662b0b1da08621e587da89f72 (patch) | |
| tree | c2d4c66de43e236a7dfcbbd86df521e7c1f11d7a /run_project_tests.py | |
| parent | 0404ad5601418884f967f8917cbf763cfb7be282 (diff) | |
| download | meson-235f32f1a67f1d6662b0b1da08621e587da89f72.tar.gz | |
python: Use correct extension filename suffix on Python < 3.8.7
On Windows, in Python version prior to 3.8.7, the `sysconfig` modules
provides an extension filename suffix that disagrees the one returned
by `distutils.sysconfig`. Get the more awesome suffix from the latter
when building for a Python version known to present this issue.
Simplify the extension module filename suffix lookup to use the same
method used by `setuptools`.
Adjust project tests accordingly.
Fixes #10960.
Diffstat (limited to 'run_project_tests.py')
| -rwxr-xr-x | run_project_tests.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 8be63b29d..47acb2169 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -177,7 +177,15 @@ class InstalledFile: return p if self.typ == 'python_lib': return p.with_suffix(python_suffix) - if self.typ in ['file', 'dir']: + if self.typ == 'py_implib': + p = p.with_suffix(python_suffix) + if env.machines.host.is_windows() and canonical_compiler == 'msvc': + return p.with_suffix('.lib') + elif env.machines.host.is_windows() or env.machines.host.is_cygwin(): + return p.with_suffix('.dll.a') + else: + return None + elif self.typ in {'file', 'dir'}: return p elif self.typ == 'shared_lib': if env.machines.host.is_windows() or env.machines.host.is_cygwin(): @@ -211,15 +219,13 @@ class InstalledFile: if self.version: p = p.with_name('{}-{}'.format(p.name, self.version[0])) return p.with_suffix('.pdb') if has_pdb else None - elif self.typ in {'implib', 'implibempty', 'py_implib'}: + elif self.typ in {'implib', 'implibempty'}: if env.machines.host.is_windows() and canonical_compiler == 'msvc': # only MSVC doesn't generate empty implibs if self.typ == 'implibempty' and compiler == 'msvc': return None return p.parent / (re.sub(r'^lib', '', p.name) + '.lib') elif env.machines.host.is_windows() or env.machines.host.is_cygwin(): - if self.typ == 'py_implib': - p = p.with_suffix(python_suffix) return p.with_suffix('.dll.a') else: return None |
