mesonbuild / meson-python

Meson PEP 517 Python build backend
https://mesonbuild.com/meson-python/
MIT License
118 stars 59 forks source link

meson-python does not recognize the reported extension suffixes for ppc PyPy #563

Closed wshanks closed 5 months ago

wshanks commented 5 months ago

When trying to update the conda-forge feedstock for scs-python to use meson-python here, I found that the ppc64le pypy build fails with an assertion error here:

https://github.com/mesonbuild/meson-python/blob/9d0fa1336fe18ffcd258b31c327ff3c5a020532e/mesonpy/__init__.py#L78-L79

I added debug printing to the build script in this commit to see what was in EXTENSION_SUFFIXES and found

['.pypy39-pp73-ppc_64-linux-gnu.so', 'ppc_64-linux-gnu']

For comparison, the other PyPy builds show Linux x86 ['.pypy39-pp73-x86_64-linux-gnu.so'], Linux aarch64 ['.pypy39-pp73-x86_64-linux-gnu.so'], macOS x86 ['.pypy39-pp73-darwin.so'], and Windows ['.pypy39-pp73-win_amd64.pyd']. (Side note: I don't know why aarch64 is reporting x86, but it might be related to other issues I have had with getting the build fully working).

This error is currently a blocker for a ppc64le pypy build. Since I think this is a niche of a niche of a niche (conda-forge->pypy->ppc), I was leaning towards just dropping that build variant, but I wanted to at least report it. It is possible that that this is a PyPy issue or a conda-forge ppc PyPy packaging issue, but I thought I would start by reporting it here. Maybe meson-python could be less strict and just issue a warning? Or just add those suffixes to the list of files it looks for?

dnicolodi commented 5 months ago

I added debug printing to the build script in this commit to see what was in EXTENSION_SUFFIXES and found

['.pypy39-pp73-ppc_64-linux-gnu.so', 'ppc_64-linux-gnu']

Your Pypy is broken: ppc_64-linux-gnu is clearly not a valid extension module filename extension. I have no idea how you managed to get that added to importlib.machinery.EXTENSION_SUFFIXES, but it clearly should not be there. I don't think that meson-python should add work-arounds for broken Python installations.

The fact that EXTENSION_SUFFIXES is broken also for your Linux aarch64 Pypy build is definitely something you need to fix.

rgommers commented 5 months ago

Since I think this is a niche of a niche of a niche (conda-forge->pypy->ppc), I was leaning towards just dropping that build variant, but I wanted to at least report it.

I'd drop it indeed. A report is always helpful though for the next person running into this, so thanks for that.

I don't think that meson-python should add work-arounds for broken Python installations.

Agreed. Sometimes we need to work around weirdness in Python itself, but this is too obviously a bug in conda-forge's Python packaging, it should be fixed there.

wshanks commented 5 months ago

Thanks for the feedback! I moved this to https://github.com/conda-forge/pypy3.6-feedstock/issues/115.