Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ jobs:
uses: ./.github/actions/nix-build-retry
with:
attr: .#${{ matrix.attr }}
- name: Check glibc floor
if: ${{ matrix.attr != '' }}
run: ./scripts/check-glibc-floor.sh "${{ matrix.attr }}"

nix-build-checks-aarch64-linux:
name: >-
Expand Down Expand Up @@ -192,6 +195,9 @@ jobs:
uses: ./.github/actions/nix-build-retry
with:
attr: .#${{ matrix.attr }}
- name: Check glibc floor
if: ${{ matrix.attr != '' }}
run: ./scripts/check-glibc-floor.sh "${{ matrix.attr }}"

nix-build-checks-x86_64-linux:
name: >-
Expand Down
20 changes: 20 additions & 0 deletions scripts/check-glibc-floor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Fails if any file in ./result requires a glibc symbol version above MAX_ALLOWED.
set -Eeu -o pipefail

MAX_ALLOWED="2.31"

HIT=$(find -L result -type f -exec sh -c \
'objdump -T "$1" 2>/dev/null | grep -oE "GLIBC_[0-9.]+" | sed -E "s#GLIBC_([0-9.]+)#\1 $1#"' _ {} \; |
sort -V | tail -1)

if [ -z "$HIT" ]; then
exit 0
fi

FLOOR=${HIT%% *}
echo "glibc floor: $FLOOR (max allowed: $MAX_ALLOWED)"
if [ "$(printf '%s\n%s' "$MAX_ALLOWED" "$FLOOR" | sort -V | tail -1)" != "$MAX_ALLOWED" ]; then
echo "::error::glibc floor $HIT exceeds max allowed $MAX_ALLOWED in ${1:-result}"
exit 1
fi
Loading