Even though meson supports cross compiling, it seems meson-python does not.
| @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= [] |
| |
| forpath, _inself._wheel_files['platlib']: |
| ifpath.suffix==soext: |
| match=re.match(r'^[^.]+(.*)$', path.name) |
| assertmatchisnotNone |
| suffix=match.group(1) |
| ifsuffixnotin_EXTENSION_SUFFIXES: |
| raiseValueError( |
| 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) |
| assertmatchisnotNone |
| abis.append(match.group('abi')) |
| |
| stable= [xforxinabisifxandre.match(r'abi\d+', x)] |
| iflen(stable) >0andlen(stable) ==len(abis) andall(x==stable[0] forxinstable[1:]): |
| returnstable[0] |
| returnNone |
assumes that the extension is run on the same interpreter.
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.
cc @h-vetinari, @rgommers, @eli-schwartz
Even though meson supports cross compiling, it seems meson-python does not.
meson-python/mesonpy/__init__.py
Lines 313 to 348 in 78861f5
We use crossenv to cross compile in conda-forge and crossenv monkey-patches some things but monkey-patching
importlib.machinery.EXTENSION_SUFFIXESdoes not seem like a good idea.cc @h-vetinari, @rgommers, @eli-schwartz