On 12/10/21 09:13, Zbigniew Jędrzejewski-Szmek wrote:
On Fri, Dec 10, 2021 at 10:40:33AM +0100, Vitaly Zaitsev via devel wrote:
What happens if these libraries are not installed an cannot be dl-opened?
The functionality that requires those libraries will not be available.
This is quite clever, +1.
It occurred to me that a downside might be in mysterious functionality
variances in case of latent bugs. Say, something happens to libpcre2
(file gets damaged, or ABI incompatibility creeps in, etc) so that
suddenly 'journalctl --grep' stops working. How would one find out about
the cause? From reading the journalctl code, it seems to me that
pcre2-dlopen.c:dlopen_pcre2() is called when --grep is used, and it logs
the failure, which I think addresses my concern.
So the apps using this technique would have to be written carefully, to
only dlopen() (and therefore also print possible error messages) when
the optional functionality is called for, right? If the dlopen()s were
just shotgunned at the startup, it could result in a lot of chatter.
If this technique became widely used, as it probably should, maybe there
ought to be a common way of finding out what is and isn't available. For
instance, the apps could have a special common option, like 'journalctl
--capabilities' returning
...
libpcre2 loaded, --grep enabled
libfancy NOT loaded, --FANCY disabled
..
Or, there could be a system-wide status matrix of executables vs
libraries, listing the outcome of recent dlopen()s, so that a query like
'capabilites journalctl' would return the status above (except that such
general utility would not in general be able to print what app
functionality is tied to the particular library)
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure