tests: add test that dlopen()s our weak shared library deps once - #17884
Conversation
|
Prompted by #17769 |
|
Nice, this will help a lot! What about also testing libpcre2 (from journalctl.c) and libxkbcommon (from localed.c)? |
See comment in second commit msg. |
Ah sorry, missed it! Mmh it seems like on CentOS 7 libqrencode is available at build time but not in the testbed, if I'm reading this correctly: @mrc0mmand do we need an update to the CI conf? |
Not the CI config, but the image config for The Arch job is going to fail in the same manner. Ubuntu CIs don't run |
Ah yes indeed. Coming up with a diff shortly. |
|
@poettering this fix for test/test-functions fixes the issue for me: It's using pkg-config so that variability in the libdir don't bite us (hopefully). |
52aaecb to
876811b
Compare
|
@bluca Thanks a lot for tracking this down. Pulled your patch into a new commit now. PTAL! |
|
Mmh computer still says no: With the change in the test-fuction, it is working for me on Debian. @mrc0mmand any idea what could be different on CentOS? |
Well, the |
|
Actually, this is kind of an interesting situation - the build is happy with the older libqrencode, but the test isn't: |
Mmmh but it shouldn't be compiled in, in the first place, if that's the case? |
Ah yes indeed, we don't set a minimum version in Meson. In this case, the API version matches the ABI revision too, so @poettering this should suffice: Doesn't have to be fixed now, but as a separate change I think we should get the soname of the dlopen'ed libraris from Meson. We are lucky in this case, but ABI revisions can and will change without API breakages at some point in some of these. Once we do that, we can remove the above restrictions, which will make qrencode unavailable on CentOS 7/RHEL 7 even though it could be supported, since we don't seem to be affected by the API level changes - given it built just fine. |
Let's add a dlopen_qrencode() function that does the actual dlopen() stuff and caches the result. This is useful so that we later can automatically test for all dlopen hookups to work correctly.
This test should ensure we notice if distros update shared libraries that broke so name, and we still use the old soname. (In contrast to what the commit summary says, this currently doesn#t cover really all such deps, specifically xkbcommon and PCRE are missing, since they currently aren't loaded from src/shared/. This is stuff to fix later)
(Pulled from @bluca's comment here: systemd#17884 (comment) and turned into a commit by @poettering)
876811b to
a6c7811
Compare
|
Force pushed a new version, adding your suggested line. |
This way build will fail if the wrong sonames are installed at build time.