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
Linking python extensions against libpython is broken #7712
Comments
Python has two pkg-config files, one or extensions, one for embedding: > pkg-config --libs python3
> pkg-config --libs python3-embed
-lpython3.8 If you build an extension you should use |
The project that is causing problems is gst-python. There are two plugins being built there, and they seem to enforce using the embedded python for both, while I think only one of them (the Gst python plugin) needs it. The other one is a PyGobject module, so should be fine without it. What do you think @lazka ? Either way, clearly not a bug in Meson, so closing. |
I think your assessment is correct. |
We only need to link to python directly for the plugin: mesonbuild/meson#7712 (comment) Homebrew/homebrew-core#165176 (comment) Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6622>
We only need to link to python directly for the plugin: mesonbuild/meson#7712 (comment) Homebrew/homebrew-core#165176 (comment) Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6638>
We only need to link to python directly for the plugin: mesonbuild/meson#7712 (comment) Homebrew/homebrew-core#165176 (comment) Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6642>
Describe the bug
Meson has been able to detect for some time if python extensions should be linked against libpython or not. However, this only works if python was found as a
PythonDependency
and not as asPkgConfigDependency
.The problem in the code is here:
meson/mesonbuild/modules/python.py
Lines 327 to 337 in efb8608
This obviously doesn't work when I add a print statement dumping the dependencies:
To Reproduce
Just try building a Python extension against a python that ships pkg-config files: the resulting binary will always be linked against libpython.
Expected behavior
Linking against libpython should also work when python was detected through its pkg-config file.
system parameters
meson --version
: 0.55.1ninja --version
if it's a Ninja build: 1.10.1@nirbheek @lazka
The text was updated successfully, but these errors were encountered: