diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73e49999..14781f1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -142,6 +142,9 @@ jobs: if: always() run: ./build.sh build-log + - name: Check binaries + run: ./build.sh check-binaries + - name: Dist run: if [ ! "$SKIP_DISC" ]; then ./build.sh dist; else echo "meson dist skipped"; fi diff --git a/build.sh b/build.sh index f83587de..9b7b31ea 100755 --- a/build.sh +++ b/build.sh @@ -10,6 +10,8 @@ PREFIX="${PREFIX:-$HOME/iputils-install}" BUILD_OPTS="-Dprefix=$PREFIX $EXTRA_BUILD_OPTS" [ -f "meson.cross" ] && BUILD_OPTS="--cross-file $PWD/meson.cross $BUILD_OPTS" +BINARIES='arping clockdiff ping/ping tracepath' + # NOTE: meson iself checkes for minimal version # see meson_version in meson.build, it fails if not required # Meson version is 0.37.1 but project requires >=0.40. @@ -91,6 +93,37 @@ build() make -j$(getconf _NPROCESSORS_ONLN) } +check_binaries() +{ + + echo "=== check_binaries ===" + + local arch i + local bits="64" + + case "${ARCH:-}" in + '') arch='x86-64';; + arm64) arch='aarch64';; + ppc64el) arch='PowerPC';; + s390x) arch='S/390';; + esac + + if [ "${BUILD_32:-}" ]; then + bits=32 + arch='80386' + fi + + for i in $BINARIES; do + if [ "$i" = 'arping' ] && echo "$EXTRA_BUILD_OPTS" |grep -q -- '-DBUILD_ARPING=false'; then + continue + fi + + [ -x "$BUILD_DIR/$i" ] + + file "$BUILD_DIR/$i" | grep -E "$i.*${bits}-bit .*(executable|shared object).*$arch.*dynamically linked" + done +} + install() { echo "=== install ===" @@ -147,7 +180,7 @@ cd `dirname $0` cmd= case "${1:-}" in - build|build-log|configure|dependencies|dist|info|install|install-log|test|test-log|"") cmd="${1:-}";; + build|build-log|check-binaries|configure|dependencies|dist|info|install|install-log|test|test-log|"") cmd="${1:-}";; *) echo "ERROR: wrong command '$1'" >&2; exit 1;; esac @@ -167,6 +200,10 @@ if [ -z "$cmd" -o "$cmd" = "build" ]; then build fi +if [ -z "$cmd" -o "$cmd" = "check-binaries" ]; then + check_binaries +fi + if [ "$cmd" = "build-log" ]; then print_log meson-log.txt fi