Skip to content

Conversation

@ifreund
Copy link
Contributor

@ifreund ifreund commented Jan 20, 2026

The user-facing goal with this branch is to fix: #2544.

With this branch, the following patch for freebsd/src fixes the issue: https://reviews.freebsd.org/D54792

There were also several pkg bugs discovered and fixed along the way, notably BACKUP_LIBRARIES now respects ignored shlibs. This requires storing ignored shlibs in the pkg database and bumping the database version.

I'd appreciate a thorough review of the changes to the package database code as I haven't touched that part of pkg before.

See the individual commit messages for further details.

Sponsored by:	The FreeBSD Foundation
Sponsored by:	The FreeBSD Foundation
These are the same type of bug fixed in 0116512,
unfortunately that commit didn't catch all the instances.

Sponsored by:	The FreeBSD Foundation
Store ignored provided/required shlibs in the manifest and database.

This commit does not yet do anything with the ignored shlibs other than
read them from a user provided manifest and store them in the database.
Integration with shared library analysis and the existing
SHLIB_{PROVIDE,REQUIRE}_IGNORE_{GLOB,REGEX} global options will be
implemented in the next commit.

Sponsored by:	The FreeBSD Foundation
All provided/required shlibs found by pkg_analyse_files() which are not
included in shlibs_{provided,required} due to filtering are now added to
shlibs_{provided,required}_ignore instead.

Furthermore, it is now possible to filter shilbs by adding them to
shlibs_{provided,required}_ignore in a manifest passed to pkg create.

Sponsored by:	The FreeBSD Foundation
Sponsored by:	The FreeBSD Foundation
@bapt
Copy link
Member

bapt commented Jan 20, 2026

what do you think if maybe we can add a notion of "optional" shlibs required, which is only considered with if an option is turned on in pkg.conf ?

@ifreund ifreund force-pushed the shlib-ignore-manifest branch from 951231a to 867ee46 Compare January 20, 2026 11:08
@ifreund
Copy link
Contributor Author

ifreund commented Jan 20, 2026

what do you think if maybe we can add a notion of "optional" shlibs required, which is only considered with if an option is turned on in pkg.conf ?

I'm not quite sure what you are proposing. Are you proposing that we replace the concept of ignored shared libraries with optionally enforced shared library dependencies and allow users to opt in to pkg enforcing such shlib dependencies?

What end user use case do you have in mind?

@arrowd
Copy link
Contributor

arrowd commented Jan 20, 2026

In ports we're using NO_SHLIB_REQUIRES_GLOB to make pkg skip some libs when building provides/requires relations. Doesn't this PR try to solve the same issue with a different approach?

@ifreund
Copy link
Contributor Author

ifreund commented Jan 20, 2026

In ports we're using NO_SHLIB_REQUIRES_GLOB to make pkg skip some libs when building provides/requires relations. Doesn't this PR try to solve the same issue with a different approach?

First of all, this PR includes a bugfix that makes SHLIB_REQUIRE_IGNORE_GLOB function correctly with BACKUP_LIBRARIES.

As for the overlapping feature added by this PR, the ability to specify ignored shlibs in the manifest is motivated by the structure of the src build system where there is no good way to pass pkgbase-package-specific arguments to pkg create. Being able to specify ignored shilbs in the manifest is much more convenient there.

@bapt
Copy link
Member

bapt commented Jan 20, 2026

In ports we're using NO_SHLIB_REQUIRES_GLOB to make pkg skip some libs when building provides/requires relations. Doesn't this PR try to solve the same issue with a different approach?

pkgbase will use the same mecanism as NO_SHLIB_REQUIRES_GLOB in ports, this PR, will add the information of what shlibs has been ignored into the manifest, so it will complement what we have in ports.

@bapt
Copy link
Member

bapt commented Jan 20, 2026

In ports we're using NO_SHLIB_REQUIRES_GLOB to make pkg skip some libs when building provides/requires relations. Doesn't this PR try to solve the same issue with a different approach?

First of all, this PR includes a bugfix that makes SHLIB_REQUIRE_IGNORE_GLOB function correctly with BACKUP_LIBRARIES.

As for the overlapping feature added by this PR, the ability to specify ignored shlibs in the manifest is motivated by the structure of the src build system where there is no good way to pass pkgbase-package-specific arguments to pkg create. Being able to specify ignored shilbs in the manifest is much more convenient there.

yes this is what I was thinking about, but I was over thinking, so ignore my previous comment.

@bapt bapt merged commit 32a1ebd into freebsd:main Jan 20, 2026
8 of 9 checks passed
@ifreund ifreund deleted the shlib-ignore-manifest branch January 20, 2026 14:51
ifreund added a commit to ifreund/freebsd-src that referenced this pull request Jan 20, 2026
The FreeBSD-clang package contains a 32-bit shared object at
/usr/lib/clang/19/lib/freebsd/libclang_rt.asan-i386.so

This is expected, since clang uses this object when compiling for i386
targets with asan enabled.

What is not expected is that the FreeBSD-clang package current depends
on 32-bit libc packages due to pkg's shared library analysis, making it
impossible to install pkgbase on x86_64 without any lib32 packages.

This commit leverages a new pkg feature implemented in [1], but could
be landed before a pkg version including that feature is released
without any ill effects. Unknown keys in package manifests are ignored.

[1]: freebsd/pkg#2594

Sponsored by:	The FreeBSD Foundation
ifreund added a commit to ifreund/freebsd-src that referenced this pull request Jan 20, 2026
The FreeBSD-clang package contains a 32-bit shared object at
/usr/lib/clang/19/lib/freebsd/libclang_rt.asan-i386.so

This is expected, since clang uses this object when compiling for i386
targets with asan enabled.

What is not expected is that the FreeBSD-clang package current depends
on 32-bit libc packages due to pkg's shared library analysis, making it
impossible to install pkgbase on x86_64 without any lib32 packages.

This commit leverages a new pkg feature implemented in [1], but could
be landed before a pkg version including that feature is released
without any ill effects. Unknown keys in package manifests are ignored.

[1]: freebsd/pkg#2594

Sponsored by:	The FreeBSD Foundation
ifreund added a commit to ifreund/freebsd-src that referenced this pull request Jan 20, 2026
The FreeBSD-clang package contains a 32-bit shared object at
/usr/lib/clang/19/lib/freebsd/libclang_rt.asan-i386.so

This is expected, since clang uses this object when compiling for i386
targets with asan enabled.

What is not expected is that the FreeBSD-clang package currently depends
on 32-bit libc packages due to pkg's shared library analysis, making it
impossible to install pkgbase on x86_64 without any lib32 packages.

This commit leverages a new pkg feature implemented in [1], but could
be landed before a pkg version including that feature is released
without any ill effects. Unknown keys in package manifests are ignored.

[1]: freebsd/pkg#2594

Sponsored by:	The FreeBSD Foundation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lib32 not installed - but required when update

3 participants