libpkg: make shlib handling portable #2386
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All shared objects NEEDED by an ELF file are added to shlibs_required by pkg-create rather than filtering them based on the host system ELF hints file and installed libraries.
The ALLOW_BASE_SHLIBS option is deprecated and ignored.
Before running the solver, pkg now scans /lib and /usr/lib (taking --rootdir into account) and builds a list of system-provided shlibs that is used as an input to the solver. If pkg detects that it is targeting a pkgbase system this scan for system shlibs is skipped as the base packages will provide all necessary shlibs.
The detection of a pkgbase system is implemented by checking if /usr/bin/uname is tracked in the pkg database.
The main user-facing change is that pkg-create now adds all shared objects listed as NEEDED by an ELF file to shlibs_required. In general this should not cause issues due to the solver taking the shlibs provided by the base system into account but there may be exceptions where manual filtering is necessary. For this purpose, SHLIB_REQUIRE_IGNORE_GLOB and SHLIB_REQUIRE_IGNORE_GLOB are added in the second commit.
References: #2331