Files
floci/.github/scripts/check-glibc-floor.sh
T
Hector Ventura 5370920012 chore(release): publish standalone floci-aws binaries as release assets (#5844)
* chore(release): publish standalone floci-aws binaries as release assets

The release already built Linux native executables, but only to package them
into the images; they were discarded after a day and releases carried no
assets. Users without Docker had nothing to download.

release.yml now also builds macOS (arm64, and x86_64 under Rosetta) and Windows
x86_64 binaries with GraalVM Community, smoke-tests every binary on its own
runner with .github/scripts/smoke-binary.sh (version matches the tag, SQS and
DynamoDB round trips, clean stop on SIGTERM), and checks that the Linux amd64
binary still starts on glibc 2.34 (Ubuntu 22.04). A new publish-binaries job,
the only one with write access to the release, stages the six executables as
floci-aws-<os>-<arch>, writes sha256sums.txt, signs every file with keyless
cosign sign-blob, attests build provenance, and uploads them to the release
semantic-release created. Build artifacts are kept 7 days so that job can be
re-run on its own.

make native-install now installs floci-aws, since floci is the CLI.

Refs #5767

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(release): check the glibc 2.34 floor on every Linux binary and wait for the release

Review follow-ups for the binary release jobs:

- The floor check started the amd64 binary on Ubuntu 22.04, whose glibc is
  2.35, so a binary that needed 2.35 would have passed. check-glibc-floor.sh
  now reads the newest GLIBC_ symbol version the binary requires with
  readelf and fails above 2.34, then starts it in UBI 9, whose glibc is 2.34.
- The two arm64 builds had no floor check at all; they run the same script.
- publish-binaries waits up to 10 minutes for semantic-release to create the
  GitHub Release before uploading, instead of failing if it is not there yet.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(release): build darwin-amd64 with a pinned, checksummed GraalVM Community

The macOS x86_64 job downloaded Oracle GraalVM from download.oracle.com's
"latest" URL: not the Community build the job's comment names, unpinned and
unchecked, though its output is then signed and attested as ours. It now
fetches GraalVM Community 25.0.1, the last release with a macOS x64 build,
from graalvm-ce-builds and checks it against the published SHA-256 before
extracting it.

The publish-binaries header said semantic-release creates the release
before pushing the tag; it pushes the tag first, as the upload step says.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-17 12:36:20 -04:00

35 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# check-glibc-floor.sh <binary> [floor]
#
# A Linux release binary links glibc dynamically and must run on glibc 2.34 (RHEL 9, Debian 12,
# Ubuntu 22.04, Amazon Linux 2023). Two checks, so a toolchain change that raises the floor fails
# the release instead of the user:
# 1. the newest GLIBC_x.y symbol version the binary requires is at most the floor (readelf reads
# any architecture's ELF, so this covers the arm64 builds too);
# 2. the binary starts in UBI 9, whose glibc is exactly 2.34 (skipped when Docker is absent).
set -euo pipefail
BIN=$1
FLOOR=${2:-2.34}
newest=$(readelf --version-info --wide "$BIN" | grep -o 'GLIBC_[0-9][0-9.]*' | sed 's/GLIBC_//' | sort -uV | tail -1)
if [ -z "$newest" ]; then
echo "FAIL: no GLIBC_ symbol versions found in $BIN"
exit 1
fi
if [ "$(printf '%s\n%s\n' "$newest" "$FLOOR" | sort -V | tail -1)" != "$FLOOR" ]; then
echo "FAIL: $BIN requires GLIBC_$newest, newer than the $FLOOR floor"
exit 1
fi
echo "ok: newest required glibc symbol is GLIBC_$newest (floor $FLOOR)"
if ! command -v docker >/dev/null 2>&1; then
echo "skip: no Docker, start check not run"
exit 0
fi
docker run --rm -v "$(cd "$(dirname "$BIN")" && pwd)/$(basename "$BIN"):/floci-aws:ro" \
registry.access.redhat.com/ubi9/ubi:latest sh -c \
'/floci-aws -Dquarkus.http.port=0 > /tmp/out 2>&1 & pid=$!; sleep 5
if kill -0 "$pid" 2>/dev/null; then echo "ok: starts on $(ldd --version | head -1)"; kill "$pid"
else cat /tmp/out; exit 1; fi'