-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
build-system: add option to revert back to classic shared library deps instread of dlopen(), for downstreams where minimal, runtime-combined OS images are a non-issue #17769
Comments
you might be interested in #17416 |
Also some distros, e.g. ALT Linux (cc @shaba ), make RPM dependencies from real ABI symbols used (they create a hash of used symbols in Requires and hash of available ones in Provides), so they track not only the soname, but also real ABI. Using dlopen will break this mechanics of guaranteeing ABI consistency. |
I have the same problem in Debian as you. We don't have any tooling to handle dlopenend dependencies automatically. I suggested a different approach in #17416 (comment) but @poettering doesn't like it. |
We in RPM can do sth like the following build-time automation of adding dependencies which is probably impossible in Debian:
But:
|
Also, the list of dlopen'ed libraries is, I would say, very partial, for example, I encountered problems with ABI of libseccomp, so this solution with dlopen does not fully solve existing problems and creates new problems. |
systemd/src/shared/cryptsetup-util.c Line 38 in bb2d0a2
What if soname is different at build time?! Nobody will notice it, the package will be build successfully, but dlopenning may not work out of the box! that is a complete crap, I believe, for a distro package. Or am I wrong? |
One advantage of |
If the name changes (i.e. the number after the |
The problem is that it is not detected at build time and cannot be detected as a requirement by existing tools. |
regression of stability? What do you mean by that? The builds are as stable as before? There are no memory corruptions or anything introduced by that, even if the shared libraries are updated. So not sure what you mean by "stability". If you want we can add a test case that tries to load all shared libs we open once, which will fail if they aren't installed. This way you'll catch failure of missing .so during build time at least. Which isn#t the same as runtime, but close enough, no? |
07.12.2020 16:00, Lennart Poettering пишет:
regression of /stability/? What do you mean by that?
When I build systemd RPM without dlopen(), I am sure that:
* all dependencies are resolved automatically and are installed
* I know that everything will work _not_ differently on different systems
* if e.g. libcryptsetup soname changes, I will find out that systemd has to be rebuilt by e.g. dnf repoquery --qf '%{sourcerpm}' --whatrequires 'libcryptsetup.so.N()(64bit)', but in case of dlopen() it will start to fail loading libcryptsetup at runtime SILENTLY for the distribution build system.
It is a repository-wide standard process of ensuring that packages are not broken. At _this_ moment distros cannot deal with dlopen() in terms of ensuring consistency.
Do you see my point?
If you want we can add a test case that tries to load all shared libs we open once, which will fail if they aren't installed.
Yes, ensuring dlopenability and ABI consistency at build time is much better than nothing!
…
This way you'll catch failure of missing .so during build time at least. Which isn#t the same as runtime, but close enough, no?
|
Hmm, that's what meson and pkg-config are actually responsible for: managing deps at build time.
Uh, what? The ELF shared library dep header actually list the very same .so names as we do. You could argue that listing them explicitly in our code is a lot safer, since we pin the library versions explicitly.
Yeah, distro build tools currently have no nice way to automatically deal with such deps. Something to fix though. In those distro build tools. Such soft dependencies are very common, much more common than you might assume btw. The libxkbcommon dep in systemd has been like this for many many years, and plenty other packages use dlopen() like this too to minimize dep trees. |
See #17884 |
I agree that distro build tools should be able to deal with them, but I am having trouble figuring out how they should do so. Is there a way to extract them from the compiled binary, without resorting to |
@DemiMarie see #17416, wich uses objcopy to extract them from an ELF binary, after they have been declared in sources. |
Hello,
systemd-247 started using dlopen()
as a package maintainer I would very much like to avoid adding dependencies manually. It will require:
Is it possible to make a configure option to off dlopen and return to old behaviour?
The text was updated successfully, but these errors were encountered: