Add check for max glibc version (#1458)

* Add check for max glibc version

* checkout first

* tolerate subversions

* exit better

* rename ci gen script
This commit is contained in:
Rahuλ Dé 2022-12-31 11:16:39 +00:00 committed by GitHub
parent 1e06b07d0f
commit 34136173d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 2 deletions

View file

@ -29,7 +29,7 @@ jobs:
- run:
name: Generate config
command: |
/tmp/bbb .circleci/script/short_ci.clj > generated_config.yml
/tmp/bbb .circleci/script/gen_ci.clj > generated_config.yml
- continuation/continue:
configuration_path: generated_config.yml

View file

@ -1,4 +1,4 @@
(ns short-ci
(ns gen-ci
(:require
[babashka.tasks :as tasks]
[clj-yaml.core :as yaml]
@ -154,6 +154,8 @@ java -jar \"$jar\" --config .build/bb.edn --deps-root . release-artifact \"$refl
:steps (gen-steps shorted?
(filter some?
[:checkout
(when (contains? #{"linux" "linux-aarch64"} platform)
(run "Check max glibc version" "script/check_glibc.sh"))
{:attach_workspace {:at "/tmp"}}
(run "Pull Submodules" "git submodule init\ngit submodule update")
{:restore_cache

15
script/check_glibc.sh Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
function ver_lte() {
printf '%s\n%s' "$1" "$2" | sort -C -V
}
max_glibc_version="2.31"
current_glibc_version=$(ldd --version | head -1 | awk '{print $4}' | cut -d "-" -f 1)
function bail() {
echo "glibc greater than max version ${max_glibc_version}: ${current_glibc_version}"
exit 1
}
ver_lte "${current_glibc_version}" "${max_glibc_version}" || bail