build: Detect if Python.h header is present#163
Conversation
1902652 to
7ea3108
Compare
|
@eli-schwartz sorry to ask such a simple question but I was not able to find anything in the meson documentation on this topic. Is this the way how we are supposed to check if 'Python.h' is installed on the system? One thing which bothers me, do we actually know it's the matching Python.h version with the Python interpreter found in the path. |
|
The py3_dep should ensure that the include directory from the matching interpreter is found first, if at all. BTW you could use You should never find the wrong header either, because it won't ever be directly in the default search path as Usually the fact that a dependency is successfully found means that the development headers must be installed, but python is a bit special as we can resolve it via sysconfig if pkg-config files are absent. I wonder if that could be fixed in meson... |
|
Thanks @eli-schwartz. Will change to The question on which Python interpreter is used popped up in #72. If I understood it correctly, during the setup step Python 3.6 (with devel package installed) is detected. But during the build Python 3.9 is used which doesn't have the Python.h header file installed. Hmm, that would also mean my header test here wouldn't be enough I suppose. |
|
On a second thought, if in #72 Python 3.6 is found (so my previous claim is wrong about two different python version invovled) but there is nothing checking if the header files are present this PR would indeed be the right fix. |
Make sure the devel package is also installed not just the the Python interpreter. Signed-off-by: Daniel Wagner <dwagner@suse.de>
7ea3108 to
0aa9527
Compare
I don't understand this. If you have multiple versions of python installed on your system (one of which has a devel package installed, and which you want to build against) then meson will always consistently use whichever python it found in find_installation. It may be the wrong python, hence no devel headers, but it should NEVER detect one during If the wrong python is detected, this can be overridden using, for example, a Which one is the "right" python in meson's original detection may be based on which one the |
Sorry, my bad. I got confused again because I was still thinking in the Makefile based world :)
Nice! Thanks for explaining. |
|
No problem, happy to help. :)
It's not necessarily such a simple question. ;) Anyway, I'm actually quite willing to have people ping me for meson questions and/or ask for my style review on meson changes (no promises about project specific details, but I can definitely provide advice on what meson is capable of). |
Make sure the devel package is also installed not just the the Python
interpreter.
Signed-off-by: Daniel Wagner dwagner@suse.de
Fixes: #72