-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Even though meson supports cross compiling, it seems meson-python does not.
meson-python/mesonpy/__init__.py
Lines 313 to 348 in 78861f5
@cached_property | |
def _stable_abi(self) -> Optional[str]: | |
"""Determine stabe ABI compatibility. | |
Examine all files installed in {platlib} that look like | |
extension modules (extension .pyd on Windows, .dll on Cygwin, | |
and .so on other platforms) and, if they all share the same | |
PEP 3149 filename stable ABI tag, return it. | |
All files that look like extension modules are verified to | |
have a file name compatibel with what is expected by the | |
Python interpreter. An exception is raised otherwise. | |
Other files are ignored. | |
""" | |
soext = sorted(_EXTENSION_SUFFIXES, key=len)[0] | |
abis = [] | |
for path, _ in self._wheel_files['platlib']: | |
if path.suffix == soext: | |
match = re.match(r'^[^.]+(.*)$', path.name) | |
assert match is not None | |
suffix = match.group(1) | |
if suffix not in _EXTENSION_SUFFIXES: | |
raise ValueError( | |
f'Extension module {str(path)!r} not compatible with Python interpreter. ' | |
f'Filename suffix {suffix!r} not in {set(_EXTENSION_SUFFIXES)}.') | |
match = _EXTENSION_SUFFIX_REGEX.match(suffix) | |
assert match is not None | |
abis.append(match.group('abi')) | |
stable = [x for x in abis if x and re.match(r'abi\d+', x)] | |
if len(stable) > 0 and len(stable) == len(abis) and all(x == stable[0] for x in stable[1:]): | |
return stable[0] | |
return None |
We use crossenv to cross compile in conda-forge and crossenv monkey-patches some things but monkey-patching
importlib.machinery.EXTENSION_SUFFIXES
does not seem like a good idea.
h-vetinari, doronbehar and agriyakhetarpal
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request