#!/usr/bin/env bash # The glibc ceiling of a shipped Linux binary (main, 7 October 2026: a seed took 14 restarts and three minutes down on a binary # built natively on Ubuntu 24.04, glibc 2.39, while Debian 12 seeds have 2.36 and HiveOS rigs less). Rule: anything that ships to # a seed or a rig needs at most GLIBC_2.36; tools/build-remote.sh --ship and tools/workers-remote.sh build with zig for that and run # this on every artefact they fetch. Reads the versioned symbol needs (`objdump -T`, or `nm -D` where objdump is absent) and compares # the highest GLIBC_x.y with the ceiling. # # Classes (main, 7 October 2026, after RunPod's Ubuntu 22.04 canaries refused GLIBC_2.38 binaries and a 2.36 HiveOS package would # not run on a real rig): the ceiling is per artefact class, in this one table, read with --class: # hive, rig 2.31 HiveOS images are Ubuntu 20.04 based; the HiveOS package and anything for a rig # seed, linux 2.35 Debian 12 seeds (2.36) and Ubuntu 22.04 hosts and containers (2.35); generic Linux # native none the box and Ubuntu 24.04 hosts; a native build, not checked # # tools/ci/glibc-ceiling-check.sh [ceiling, default 2.36] exit 0 when the need is at or under the ceiling # tools/ci/glibc-ceiling-check.sh --class the ceiling from the class table above # tools/ci/glibc-ceiling-check.sh --ceiling-of print the class's ceiling (the build tools read it here) # tools/ci/glibc-ceiling-check.sh --symbols [ceiling] the same from a saved `objdump -T` text (the self-test, CI without ELF tools) # tools/ci/glibc-ceiling-check.sh --self-test fires on a 2.38 need against 2.36, passes 2.34 against 2.36 and 2.36 against 2.36 set -euo pipefail class_ceiling() { case "$1" in hive|rig) echo 2.31 ;; seed|linux) echo 2.35 ;; native) echo native ;; *) echo "glibc-ceiling: unknown class '$1' (hive, rig, seed, linux, native)" >&2; return 2 ;; esac; } ceiling_of() { grep -oE 'GLIBC_[0-9]+\.[0-9]+' | sed 's/GLIBC_//' | sort -t. -k1,1n -k2,2n | tail -1; } le() { [ "$(printf '%s\n%s\n' "$1" "$2" | sort -t. -k1,1n -k2,2n | tail -1)" = "$2" ]; } # $1 <= $2 as glibc versions judge() { #