-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3.8 and python3-config --libs
#5629
Comments
The python module handles the first part this since #4187 edit: oh, it's the other way around in that pkg-config no longer makes it link against libpython.. never mind then :/ I guess we need to an an option to the python module somehow for this new case. |
There is a new "python-embed.pc" in 3.8, have you tried that? |
Python 3.8 no longer links to libpython, resulting in undefined references to Python API. But it provides a python3-embed.pc now, so let's try using that first and only fall back on the normal case if that fails. See mesonbuild/meson#5629
Yep, changing to |
Python 3.8 no longer links to libpython, resulting in undefined references to Python API. But it provides a python3-embed.pc now, so let's try using that first and only fall back on the normal case if that fails. See mesonbuild/meson#5629
Thanks everybody. I guess we can close this issue. |
I'm not sure this is the correct fix; the fix should work on all python versions. If it is, we should document it somewhere? |
The bigger issue is how should Python dependencies looked up via the Python module work? That one probably needs a new kwarg because you can not specify which dependency name to use. |
I've also got one bug https://bugzilla.redhat.com/show_bug.cgi?id=1718283. I think proper way would be to use some kwarg which would choose between -embed and normal python. |
Seems reasonable. |
We have a new pkgconfig to check for when using python 3.8 so that we actually link against Python. See also: mesonbuild/meson#5629 libratbag/libratbag@7de944a
Checking for Also related bug: https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28 |
yes, precisely, I reckon an |
If If
Incorrect, projects which expect to build against some version of python 3.x must not hardcode If it were appropriate to look up |
@eli-schwartz You're missing the point. There could be multiple Python versions installed on a system, which is the case on Debian for example (right now: 2.7, 3.7 and 3.8). One Python 3 version is going to be the default (and have the corresponding See https://gitlab.freedesktop.org/gstreamer/gst-python/ for an example meson build system that allows to select the Python version. Using |
If you're not using pkg-config in the first place, then why are you suggesting that "checking python3-embed.pc is insufficient"? Moreover, why are you suggesting that the correct way is to call Using meson's python module via find_installation().dependency() already checks the major.minor version of the detected python binary, then looks for The recommendation in previous comments "have you tried python3-embed.pc" was strictly a recommendation for users who are currently using The same logic would always apply to autotools, which doesn't automatically resolve |
A bit hacky, but you could do arbitrary version selection yourself (no need for the python module) like this:
Alternatively (this prints up to 3 missing unrequired dependencies first):
|
Checking for a generic
Your workaround to parse the Python version and then look for the corresponding |
This should be fixed with #6341. It explicitly checks for |
Patch to add --embed flag to config-python when interface=python and using python@3.8: This is because python@3.8 changed behavior of python-config --ldflags (and --libs) such that it no longer includes -lpython unless --embed flag is used. See e.g. mesonbuild/meson#5629
Patch to add --embed flag to config-python when interface=python and using python@3.8: This is because python@3.8 changed behavior of python-config --ldflags (and --libs) such that it no longer includes -lpython unless --embed flag is used. See e.g. mesonbuild/meson#5629
Quoting https://bugzilla.redhat.com/show_bug.cgi?id=1718290:
In libratbag, we are using swig to generate a Python library that we link with a dependencies of
dependency('python3')
. I wasn't able to find out how the pkg-config was invoced, so I can not really submit a patch.The text was updated successfully, but these errors were encountered: