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
pkgconfig: fix use of uninstalled libraries #12769
base: master
Are you sure you want to change the base?
Conversation
32e0cac
to
c01cf98
Compare
Never understood why python is missing that... You want |
LGTM if CI pass this time :) |
If for ex
Yeah :) I keep making the same mistake over and over every time I come back to Python :) |
@ylatuya I tried build the meson from your repo and try it, but still it's appeneded at the end. PKG_CONFIG_PATH=/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/pkgconfig:/snap/gnome-42-2204-sdk/current/usr/lib/pkgconfig:/snap/gnome-42-2204-sdk/current/usr/share/pkgconfig:/root/stage/usr/lib/x86_64-linux-gnu/pkgconfig:/root/parts/gstreamer/build/meson-uninstalled CC=cc /snap/gnome-42-2204-sdk/current/usr/bin/g-ir-scanner --quiet --no-libtool --namespace=GstVideo --nsversion=1.0 --warn-all --output subprojects/gst-plugins-base/gst-libs/gst/video/GstVideo-1.0.gir '--add-init-section=extern void gst_init(gint*,gchar**);g_setenv("GST_REGISTRY_DISABLE", "yes", TRUE);g_setenv("GST_REGISTRY_1.0", "/root/parts/gstreamer/build/subprojects/gst-plugins-base/gir_empty_registry.reg", TRUE);g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);gst_init(NULL,NULL);' --quiet --c-include=gst/video/video.h -I/root/parts/gstreamer/src/subprojects/gst-plugins-base/gst-libs/gst/video -I/root/parts/gstreamer/build/subprojects/gst-plugins-base/gst-libs/gst/video -I/root/parts/gstreamer/src/subprojects/gst-plugins-base/. -I/root/parts/gstreamer/build/subprojects/gst-plugins-base/. -I/root/parts/gstreamer/src/subprojects/gst-plugins-base/gst-libs -I/root/parts/gstreamer/build/subprojects/gst-plugins-base/gst-libs -I/root/parts/gstreamer/src/subprojects/gstreamer/libs -I/root/parts/gstreamer/build/subprojects/gstreamer/libs -I/root/parts/gstreamer/src/subprojects/gstreamer/. -I/root/parts/gstreamer/build/subprojects/gstreamer/. --filelist=/root/parts/gstreamer/build/subprojects/gst-plugins-base/gst-libs/gst/video/libgstvideo-1.0.so.0.2208.0.p/GstVideo_1.0_gir_filelist --include=Gst-1.0 --include=GstBase-1.0 --symbol-prefix=gst --identifier-prefix=Gst --pkg-export=gstreamer-video-1.0 --cflags-begin -DG_DISABLE_CAST_CHECKS -I/root/parts/gstreamer/src/subprojects/gst-plugins-base/. -I/root/parts/gstreamer/build/subprojects/gst-plugins-base/. -I/root/parts/gstreamer/src/subprojects/gst-plugins-base/gst-libs -I/root/parts/gstreamer/build/subprojects/gst-plugins-base/gst-libs -I/root/parts/gstreamer/src/subprojects/gstreamer/libs -I/root/parts/gstreamer/build/subprojects/gstreamer/libs -I/root/parts/gstreamer/src/subprojects/gstreamer/. -I/root/parts/gstreamer/build/subprojects/gstreamer/. -I/root/parts/gstreamer/src/subprojects/gstreamer/gst/parse -I/root/parts/gstreamer/build/subprojects/gstreamer/gst/parse -I/snap/gnome-42-2204-sdk/current/usr/include/glib-2.0 -I/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/snap/gnome-42-2204-sdk/current/usr/include -I/usr/include/orc-0.4 -I/snap/gnome-42-2204-sdk/current/usr/include/gobject-introspection-1.0 --cflags-end --add-include-path=/root/parts/gstreamer/build/subprojects/gstreamer/gst --add-include-path=/root/parts/gstreamer/build/subprojects/gstreamer/libs/gst/base --add-include-path=/snap/gnome-42-2204-sdk/current/usr/share/gir-1.0 -L/root/parts/gstreamer/build/subprojects/gstreamer/libs/gst/base -L/root/parts/gstreamer/build/subprojects/gstreamer/gst -L/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu --extra-library=gstbase-1.0 --extra-library=gstreamer-1.0 -L/root/parts/gstreamer/build/subprojects/gst-plugins-base/gst-libs/gst/video --library gstvideo-1.0 -L/root/parts/gstreamer/build/subprojects/gstreamer/libs/gst/base -L/root/parts/gstreamer/build/subprojects/gstreamer/gst -L/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu -L/root/stage/usr/lib -L/root/stage/usr/lib/x86_64-linux-gnu -L/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu --extra-library=glib-2.0 --extra-library=gobject-2.0 --extra-library=gmodule-2.0 --extra-library=m --extra-library=orc-0.4 --extra-library=dl --extra-library=girepository-1.0 --sources-top-dirs /root/parts/gstreamer/src/subprojects/gst-plugins-base --sources-top-dirs /root/parts/gstreamer/build/subprojects/gst-plugins-base
2024-01-24 23:24:10.691 :: /root/parts/gstreamer/build/tmp-introspectf91wko28/GstVideo-1.0: symbol lookup error: /root/parts/gstreamer/build/tmp-introspectf91wko28/GstVideo-1.0: undefined symbol: gst_navigation_modifier_type_get_type
2024-01-24 23:24:10.691 :: Command '['/root/parts/gstreamer/build/tmp-introspectf91wko28/GstVideo-1.0', '--introspect-dump=/root/parts/gstreamer/build/tmp-introspectf91wko28/functions.txt,/root/parts/gstreamer/build/tmp-introspectf91wko28/dump.xml']' returned non-zero exit status 127. |
@soumyaDghosh how are those |
I am trying to find it out. I am still searching, but they are probably not from |
@xclaesse Can't find from where those paths are coming, not from the .bashrc that's for sure, can you guess from where these may come? I mean in general, from where do they come? |
I guess that's Ubuntu's gnome-sdk: https://github.com/ubuntu/gnome-sdk. CC @kenvandine who seems to be dev of that. |
I think I probably only fixed one part of the issue. We need to fix it as well in the the generated command in It's either this or the build files were not re-generated correctly. Can you confirm this @soumyaDghosh |
@ylatuya I tried multiple times both in github CI and local machine, and in my local machine I found no instance in the log snapcraft-clapper-on-amd64-for-amd64-11449460 ../parts/gstreamer/build# cat build.ninja | grep 'env PKG_CONFIG_PATH=/root/parts' I specifically build here with the new meson installed manually. And it still gave the same EDIT: I manually added that path to PKG_CONFIG_PATH and regenerated build.ninja, still the files were linking to the preinstalled libraries snapcraft-clapper-on-amd64-for-amd64-11449460 ../parts/gstreamer/build# ls
GstDocumentedSubprojects ci g-ir-cpp-6pnehsei.i meson-info meson-uninstalled tests
GstPluginsPath.json compile_commands.json g-ir-cpp-70fflkj7.c meson-logs scripts tmp-introspect_hxwb9yp
build.ninja g-ir-cpp-6pnehsei.c g-ir-cpp-70fflkj7.i meson-private subprojects tmp-introspectaua6km5r
snapcraft-clapper-on-amd64-for-amd64-11449460 ../parts/gstreamer/build# cd /root/parts/gstreamer/build/tmp-introspectaua6km5r/
build environment set for part 'parts'
snapcraft-clapper-on-amd64-for-amd64-11449460 ../parts/gstreamer/build/tmp-introspectaua6km5r# ldd GstVideo-1.0
linux-vdso.so.1 (0x00007ffcd5999000)
libgstvideo-1.0.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0 (0x00007fde2f29f000)
libgstbase-1.0.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0 (0x00007fde2f21a000)
libgstreamer-1.0.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 (0x00007fde2f0c7000)
libglib-2.0.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fde2ef6b000)
libgobject-2.0.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007fde2ef01000)
libgmodule-2.0.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007fde2eefa000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fde2ee0d000)
liborc-0.4.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007fde2ed88000)
libgirepository-1.0.so.1 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libgirepository-1.0.so.1 (0x00007fde2ed4a000)
libgio-2.0.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007fde2ea00000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fde2e600000)
libunwind.so.8 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007fde2ed2f000)
libdw.so.1 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libdw.so.1 (0x00007fde2ec83000)
libpcre2-8.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007fde2e969000)
libffi.so.7 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libffi.so.7 (0x00007fde2ec74000)
/lib64/ld-linux-x86-64.so.2 (0x00007fde2f370000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fde2ec58000)
libmount.so.1 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libmount.so.1 (0x00007fde2ec14000)
libselinux.so.1 => /snap/gnome-42-2204-sdk/current/lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fde2e93d000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fde2e912000)
libelf.so.1 => /lib/x86_64-linux-gnu/libelf.so.1 (0x00007fde2e8f4000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007fde2e8e1000)
libblkid.so.1 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libblkid.so.1 (0x00007fde2e8aa000) |
Well, to be sure you'd really need to check the pickled command lines used by |
Can you give me some insight on how can I do so? Also, I manually added all the paths possible to snapcraft-clapper-on-amd64-for-amd64-11449460 ../parts/gstreamer/build/tmp-introspectrqgnm0lm# ldd GstVideo-1.0
linux-vdso.so.1 (0x00007ffcf2feb000)
libgstvideo-1.0.so.0 => /root/parts/gstreamer/build/subprojects/gst-plugins-base/gst-libs/gst/video/libgstvideo-1.0.so.0 (0x00007fc48f875000)
libgstbase-1.0.so.0 => /root/parts/gstreamer/build/subprojects/gstreamer/libs/gst/base/libgstbase-1.0.so.0 (0x00007fc48f7eb000)
libgstreamer-1.0.so.0 => /root/parts/gstreamer/build/subprojects/gstreamer/gst/libgstreamer-1.0.so.0 (0x00007fc48f688000)
libglib-2.0.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fc48f52c000)
libgobject-2.0.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007fc48f4c2000)
libgmodule-2.0.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007fc48f4b9000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc48f3cc000)
liborc-0.4.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007fc48f347000)
libgirepository-1.0.so.1 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libgirepository-1.0.so.1 (0x00007fc48f30b000)
libgio-2.0.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007fc48f000000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc48ec00000)
libpcre2-8.so.0 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007fc48f272000)
libffi.so.7 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libffi.so.7 (0x00007fc48f265000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc48f99b000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fc48f249000)
libmount.so.1 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libmount.so.1 (0x00007fc48efbc000)
libselinux.so.1 => /snap/gnome-42-2204-sdk/current/lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fc48f21d000)
libblkid.so.1 => /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libblkid.so.1 (0x00007fc48ef85000) But, I still got this error FAILED: subprojects/gst-plugins-base/gst-libs/gst/video/GstVideo-1.0.gir
2024-01-25 11:23:19.538 :: env PKG_CONFIG_PATH=/root/parts/gstreamer/build/meson-uninstalled:/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/pkgconfig:/snap/gnome-42-2204-sdk/current/usr/lib/pkgconfig:/snap/gnome-42-2204-sdk/current/usr/share/pkgconfig:/root/stage/usr/lib/x86_64-linux-gnu/pkgconfig CC=cc /snap/gnome-42-2204-sdk/current/usr/bin/g-ir-scanner --quiet --no-libtool --namespace=GstVideo --nsversion=1.0 --warn-all --output subprojects/gst-plugins-base/gst-libs/gst/video/GstVideo-1.0.gir '--add-init-section=extern void gst_init(gint*,gchar**);g_setenv("GST_REGISTRY_DISABLE", "yes", TRUE);g_setenv("GST_REGISTRY_1.0", "/root/parts/gstreamer/build/subprojects/gst-plugins-base/gir_empty_registry.reg", TRUE);g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);gst_init(NULL,NULL);' --quiet --c-include=gst/video/video.h -I/root/parts/gstreamer/src/subprojects/gst-plugins-base/gst-libs/gst/video -I/root/parts/gstreamer/build/subprojects/gst-plugins-base/gst-libs/gst/video -I/root/parts/gstreamer/src/subprojects/gst-plugins-base/. -I/root/parts/gstreamer/build/subprojects/gst-plugins-base/. -I/root/parts/gstreamer/src/subprojects/gst-plugins-base/gst-libs -I/root/parts/gstreamer/build/subprojects/gst-plugins-base/gst-libs -I/root/parts/gstreamer/src/subprojects/gstreamer/libs -I/root/parts/gstreamer/build/subprojects/gstreamer/libs -I/root/parts/gstreamer/src/subprojects/gstreamer/. -I/root/parts/gstreamer/build/subprojects/gstreamer/. --filelist=/root/parts/gstreamer/build/subprojects/gst-plugins-base/gst-libs/gst/video/libgstvideo-1.0.so.0.2208.0.p/GstVideo_1.0_gir_filelist --include=Gst-1.0 --include=GstBase-1.0 --symbol-prefix=gst --identifier-prefix=Gst --pkg-export=gstreamer-video-1.0 --cflags-begin -DG_DISABLE_CAST_CHECKS -I/root/parts/gstreamer/src/subprojects/gst-plugins-base/. -I/root/parts/gstreamer/build/subprojects/gst-plugins-base/. -I/root/parts/gstreamer/src/subprojects/gst-plugins-base/gst-libs -I/root/parts/gstreamer/build/subprojects/gst-plugins-base/gst-libs -I/root/parts/gstreamer/src/subprojects/gstreamer/libs -I/root/parts/gstreamer/build/subprojects/gstreamer/libs -I/root/parts/gstreamer/src/subprojects/gstreamer/. -I/root/parts/gstreamer/build/subprojects/gstreamer/. -I/root/parts/gstreamer/src/subprojects/gstreamer/gst/parse -I/root/parts/gstreamer/build/subprojects/gstreamer/gst/parse -I/snap/gnome-42-2204-sdk/current/usr/include/glib-2.0 -I/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/snap/gnome-42-2204-sdk/current/usr/include -I/usr/include/orc-0.4 -I/snap/gnome-42-2204-sdk/current/usr/include/gobject-introspection-1.0 --cflags-end --add-include-path=/root/parts/gstreamer/build/subprojects/gstreamer/gst --add-include-path=/root/parts/gstreamer/build/subprojects/gstreamer/libs/gst/base --add-include-path=/snap/gnome-42-2204-sdk/current/usr/share/gir-1.0 -L/root/parts/gstreamer/build/subprojects/gstreamer/libs/gst/base -L/root/parts/gstreamer/build/subprojects/gstreamer/gst -L/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu --extra-library=gstbase-1.0 --extra-library=gstreamer-1.0 -L/root/parts/gstreamer/build/subprojects/gst-plugins-base/gst-libs/gst/video --library gstvideo-1.0 -L/root/parts/gstreamer/build/subprojects/gstreamer/libs/gst/base -L/root/parts/gstreamer/build/subprojects/gstreamer/gst -L/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu -L/root/stage/usr/lib -L/root/stage/usr/lib/x86_64-linux-gnu -L/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu --extra-library=glib-2.0 --extra-library=gobject-2.0 --extra-library=gmodule-2.0 --extra-library=m --extra-library=orc-0.4 --extra-library=dl --extra-library=girepository-1.0 --sources-top-dirs /root/parts/gstreamer/src/subprojects/gst-plugins-base --sources-top-dirs /root/parts/gstreamer/build/subprojects/gst-plugins-base
2024-01-25 11:23:19.539 :: /root/parts/gstreamer/build/tmp-introspectrqgnm0lm/GstVideo-1.0: symbol lookup error: /root/parts/gstreamer/build/tmp-introspectrqgnm0lm/GstVideo-1.0: undefined symbol: gst_navigation_modifier_type_get_type
2024-01-25 11:23:19.539 :: Command '['/root/parts/gstreamer/build/tmp-introspectrqgnm0lm/GstVideo-1.0', '--introspect-dump=/root/parts/gstreamer/build/tmp-introspectrqgnm0lm/functions.txt,/root/parts/gstreamer/build/tmp-introspectrqgnm0lm/dump.xml']' returned non-zero exit status 127. |
Prepend the path of uninstalled libraries to PKG_CONFIG_PATH so they have preference over other search paths set by the user. see: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3247
I have added a couple of unit tests to verify how |
c01cf98
to
03bb442
Compare
I think the issue is probably with gstreamer also, because even though the linking of the file was properly, it showed the same error! |
Let's try to go step by step. The way
In the first logs you have shared, we can see that the error is in step 4. When
This is the first thing that needs to be fixed and my original guess is that an incorrect order of search directories in PKG_CONFIG_PATH would cause it. In this comment you have shared a new output of ldd of
Does the patch in this PR fix this problem? |
Actually it doesn't. I manually added the meson-uninstalled folder to the EDIT: Also, this is linked with correct libraries, I still get the symbol not found error. |
Thanks for your feedback. I originally thought it would be a linker issue caused by the incorrect order in PKG_CONFIG_PATH, which is what this PR is fixing but your issue seems a runtime linker issue, not loading the uninstalled libraries as described here: #1181. @xclaesse I think this fix should still be merged, though. |
This PR didn't fix the not adding the |
You are probably not using meson with this patch. There are 2 unit tests that validate the fix. This can be validated manually like:
|
Okay. let's merge this, and I'll try to give a PR to the gnome-sdk to update this in the SDK. But, is there any chance of a new release anytime soon? |
I suspect https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3247 might be caused by this issue in meson.
We should prepend the path of uninstalled libraries to PKG_CONFIG_PATH so they have preference over other search paths set by the user.
Support for using uninstalled libraries was added by @xavierclaessens in #10275.