Linux: compute .deb libc6 floor from non-weak GLIBC_* symbols (#252) (#950)

Co-authored-by: Urdemonlord <150226383+Urdemonlord@users.noreply.github.com>
This commit is contained in:
Precious OkwuandUrdemonlord authored and GitHub committed 2026-11-25 17:36:41 +01:00
1 parent 143bc926e7
commit f85d40769a
2 files changed
+25 -1

No files matched your search

+12 -1
View File
@@ -48,6 +48,17 @@ if [ -n "$window" ]; then
[ -x "$window" ] || { echo "no $window" >&2; exit 1; }
window=$(cd "$(dirname "$window")" && pwd)/$(basename "$window")
fi
# The strongest glibc the window binary really needs: the highest non-weak
# GLIBC_ version it references. Weak refs (pidfd_spawnp, pidfd_getpid at
# 2.39) only warn on older systems, so they must not raise the floor.
# Reading the build host's glibc instead did exactly that and broke Ubuntu
# 22.04 (#252). Empty when objdump is missing or finds nothing; the caller
# then falls back to the host's version.
glibc_floor() { # binary -> e.g. 2.34
local v
v=$(command -v objdump >/dev/null 2>&1 && objdump -T "$1" 2>/dev/null | grep -v ' w ' | grep -o 'GLIBC_2\.[0-9]*' | sed 's/GLIBC_//' | sort -Vu | tail -1)
[ -n "$v" ] && printf '%s' "$v"
}
mkdir -p "$outdir"
outdir=$(cd "$outdir" && pwd)
work=$(mktemp -d)
@@ -135,7 +146,7 @@ Homepage: https://runkiri.com
Conflicts: $other
Replaces: $other
$([ "$full" = 1 ] || echo "Suggests: docker-cli | docker.io")
$([ "$full" = 1 ] && [ -n "$window" ] && echo "Depends: libc6 (>= $(ldd --version | sed -n '1s/.* //p')), libgtk-3-0t64 | libgtk-3-0, libwebkit2gtk-4.1-0")
$([ "$full" = 1 ] && [ -n "$window" ] && echo "Depends: libc6 (>= $(glibc_floor "$window" || ldd --version | sed -n '1s/.* //p')), libgtk-3-0t64 | libgtk-3-0, libwebkit2gtk-4.1-0")
$([ "$full" = 1 ] && [ -n "$window" ] && echo "Recommends: pkexec | policykit-1")
Description: Tiny, fast container runtime (Docker API)$([ "$full" = 1 ] || echo ", engine only")
Kiri runs containers on this machine's kernel and speaks the Docker API on
+13
View File
@@ -79,6 +79,19 @@ test_package() { # name full(0|1)
step "$c" "dpkg -P drops data and group" "dpkg -P $name && test ! -e /var/lib/kiri -a ! -e /var/lib/kiri-daemon && ! getent group kiri"
$docker rm -f "$c" >/dev/null 2>&1
if [ "$full" = 1 ] && dpkg-deb -I "$deb" | grep -q 'Depends:.*libc6'; then
# Ubuntu 22.04 ships glibc 2.35; the .deb must install there (#252).
echo "== .deb installs on Ubuntu 22.04 (glibc 2.35)"
local c22=kiri-deb22-test-$name debname22
debname22=$(basename "$deb")
$docker rm -f "$c22" >/dev/null 2>&1
$docker run -d --name "$c22" --privileged --tmpfs /run --tmpfs /tmp -v "$out:/pkg:ro" ubuntu:22.04 sleep infinity >/dev/null
step "$c22" "apt installs the .deb on 22.04" "apt-get update -qq >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get install -y /pkg/$debname22"
step "$c22" "window binary loads on glibc 2.35" "ldd /usr/lib/kiri/kiri-window >/dev/null 2>&1"
step "$c22" "dpkg -r removes the package" "dpkg -r $name && test ! -e /usr/bin/kiri"
$docker rm -f "$c22" >/dev/null 2>&1
fi
echo "== .rpm in a Fedora container"
local rpmname; rpmname=$(basename "$rpm")
$docker run --rm -v "$out:/pkg:ro" fedora:41 bash -c "