Note: Used a bit of AI to help with the issue. Glad to respond if you need more info.
Building bootc from source with make bin install-all regressed in v1.16.11 on distributions that do not ship libselinux development headers. v1.16.10 builds fine.
Cause
v1.16.11 added selinux to the workspace and consumes it unconditionally:
Cargo.toml:76 ([workspace.dependencies]) — selinux = "=0.5.0". Not present in v1.16.10.
crates/lib/Cargo.toml:54 — selinux = { workspace = true }, with no optional = true and no feature gate.
So every build of crates/lib now requires libselinux at link time, whether or not the target system has SELinux.
Failure
error: failed to run custom build command for `selinux-sys v0.6.15`
selinux-sys: Failed to find 'selinux/selinux.h'. Please make sure the C header
files of libselinux are installed and accessible: Kind(NotFound)
make: *** [Makefile:44: manpages] Error 1
It surfaces in the manpages target because that is the first thing to build the lib, but make bin fails the same way.
Why this is hard to work around downstream
Arch Linux packages neither libselinux nor libsepol in its official repositories, so there is no package to install:
$ curl -s 'https://archlinux.org/packages/search/json/?name=libselinux' | jq .count
0
$ curl -s 'https://archlinux.org/packages/search/json/?name=libsepol' | jq .count
0
That leaves adding a third-party repository, or building both libraries from source, purely to satisfy a link-time dependency on a system where SELinux is never enabled.
Worth noting this arrived in a patch release, so it reached anyone auto-updating within the 1.16 range.
Suggested fix
Gate it behind a cargo feature. crates/lib already uses this pattern for install-to-disk, rhsm and docgen:
# crates/lib/Cargo.toml
selinux = { workspace = true, optional = true }
[features]
default = ["install-to-disk", "selinux"]
selinux = ["dep:selinux"]
That keeps current behaviour for everyone by default and lets non-SELinux distros opt out. If the SELinux call sites are not easily made conditional, even a documented statement that libselinux is now a hard build requirement would help downstreams decide what to do.
Environment
bootc v1.16.11, built from source in an archlinux:latest container, rust from the Arch repositories. Context is an Arch-based bootc image; happy to test a patch.
Note: Used a bit of AI to help with the issue. Glad to respond if you need more info.
Building bootc from source with
make bin install-allregressed in v1.16.11 on distributions that do not ship libselinux development headers. v1.16.10 builds fine.Cause
v1.16.11 added
selinuxto the workspace and consumes it unconditionally:Cargo.toml:76([workspace.dependencies]) —selinux = "=0.5.0". Not present in v1.16.10.crates/lib/Cargo.toml:54—selinux = { workspace = true }, with nooptional = trueand no feature gate.So every build of
crates/libnow requires libselinux at link time, whether or not the target system has SELinux.Failure
It surfaces in the
manpagestarget because that is the first thing to build the lib, butmake binfails the same way.Why this is hard to work around downstream
Arch Linux packages neither
libselinuxnorlibsepolin its official repositories, so there is no package to install:That leaves adding a third-party repository, or building both libraries from source, purely to satisfy a link-time dependency on a system where SELinux is never enabled.
Worth noting this arrived in a patch release, so it reached anyone auto-updating within the 1.16 range.
Suggested fix
Gate it behind a cargo feature.
crates/libalready uses this pattern forinstall-to-disk,rhsmanddocgen:That keeps current behaviour for everyone by default and lets non-SELinux distros opt out. If the SELinux call sites are not easily made conditional, even a documented statement that libselinux is now a hard build requirement would help downstreams decide what to do.
Environment
bootc v1.16.11, built from source in an
archlinux:latestcontainer, rust from the Arch repositories. Context is an Arch-based bootc image; happy to test a patch.