-
Notifications
You must be signed in to change notification settings - Fork 279
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: allow filtering provided shlibs #2422
base: main
Are you sure you want to change the base?
Conversation
Sponsored by: The FreeBSD Foundation
Sponsored by: The FreeBSD Foundation
This is consistent with the behavior for required shlibs and will make the next commit simpler to implement correctly. Sponsored by: The FreeBSD Foundation
This allows limiting the files in a package that can affect shlibs_provided when ELF files are scanned during e.g. pkg create. The ports system will be able to populate these options automatically based on the already existing USE_LDCONFIG variable. Sponsored by: The FreeBSD Foundation
These are quite simple to implement and nicely complement the SHLIB_REQUIRE_IGNORE_{GLOB,REGEX} options. Sponsored by: The FreeBSD Foundation
Looks like the macos CI is broken due to some upstream homebrew? issue. |
ATF_REQUIRE_EQ(tll_length(p->shlibs_provided), 0); | ||
ATF_REQUIRE_EQ(pkg_analyse_elf(false, p, binpath), EPKG_OK); | ||
ATF_REQUIRE_EQ(tll_length(p->shlibs_provided), 1); | ||
ATF_REQUIRE_STREQ(tll_front(p->shlibs_provided), "libtestfbsd.so.1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test stopped checking if libtestfbsd.so.1 is provided, which changes its behavior. Is this intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intended, the analyze_elf()
function now works differently and does not directly add entries to p->shlibs_provided
. Instead, the provided shlib
is returned with an out parameter and pkg_analyze_files()
decides whether or not it should be filtered out.
This filtering cannot be done in analyze_elf()
directly as pkg_analyze_files()
must be aware of all shlibs provided by the package including filtered shlibs so that it can eliminate redundant shlibs_required
entries.
This branch adds several useful ways to filter the shared libraries automatically added to
shlibs_provided
by a pkg based on parsing the ELF/Mach-O binary. These two commits are the most relevant: