-
Notifications
You must be signed in to change notification settings - Fork 281
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
libpkg: track lib32 and Linuxulator shlibs #2387
Conversation
Note: this is not yet sufficient to fully close #2331 as lib32 and Linuxulator shlibs are not yet backed up if BACKUP_LIBRARIES is set. |
387a576
to
d204e77
Compare
Hmm, this PR causes the backup_lib test to fail on Debian for some reason. I will investigate tomorrow. |
d204e77
to
0e628a4
Compare
I've realized another blocker to resolve before merging this PR: We need to scan |
The backup_lib test is failing on Debian because pkg fails to determine that
Furthermore, the OS set in the elf header is very generic, so it wouldn't make sense for pkg to fall back on checking that:
This will also be an issue for detecting Linuxulator shlibs on FreeBSD though we don't have tests for that yet. I will investigate if there is a reliable way to detect ELF files compiled for Linux though I'm a bit worried that there is no universal solution here due to the fragmentation of the Linux ecosystem. |
Sponsored by: The FreeBSD Foundation
Sponsored by: The FreeBSD Foundation
When scanning ELF files to generate the shlibs_provided/required lists, pkg now generates entries for lib32 and Linux compat shlibs rather than ignoring all non-native shlibs. The following format is used for shlibs_provided/required entries: libfoo.so.1.0.0 - native (no change to status quo) libfoo.so.1.0.0:32 - compat 32 libfoo.so.1.0.0:Linux - compat Linux libfoo.so.1.0.0:Linux:32 - compat Linux 32 This is only done if targeting FreeBSD for now. References: freebsd#2331 Sponsored by: The FreeBSD Foundation
Since pkg now tracks 32-bit compat shlib dependencies, we must take the 32-bit compat shlibs provided by the base system into account if not targeting a pkgbase system. Sponsored by: The FreeBSD Foundation
If the target ABI is either Linux or FreeBSD and the target OS of a shared library ELF file cannot be determined, assume that it is a Linux ELF file. It is unfortunately impossible to reliably determine whether a shared library targets Linux. See the new comment in pkg_elf.c for further details. Sponsored by: The FreeBSD Foundation
81feee9
to
d726b8d
Compare
From my research, it seems to be impossible to reliably determine if an ELF shared library is targeting Linux. It is possible to reliably determine that an executable targets Linux by checking The I see 2 obvious paths we could take:
I implemented option 1. in my latest commit to this branch but would be happy to take a different approach if someone has a better idea. |
I don't think we can do better that implementing 1 for now. If we are happy with the result, then we can enable it and remove the option to disable it. TBH I don't know a case where 1 would be wrong. |
This feature needs larger scale testing before being enabled by default to avoid unnecessary disruption. This option is intended to be removed in the future if/when the feature is enabled by default. Sponsored by: The FreeBSD Foundation
@bapt that seems reasonable to me, I added a |
When scanning ELF files to generate the shlibs_provided/required lists, pkg now generates entries for lib32 and Linux compat shlibs rather than ignoring all non-native shlibs.
The following format is used for shlibs_provided/required entries:
This is only done if targeting FreeBSD for now.
I've marked this as a draft because it depends on the unmerged #2386 and because I would like to add more tests before it is merged.
References: #2331