From 33093140cbcf0ebb43d085cd4b6aa71d6e1f22f9 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Mon, 12 Feb 2024 08:58:58 -0300 Subject: [PATCH] ci: standardize ./configure arguments For consistency and to make it clearer where jobs differ (for example, to see where `--enable-analyzer` is used). Changes: * Always use --prefix=/usr and --enable-fatal-warnings (except in the Alpine job due to current warnings; see #6224) * Use the same argument order Note: mkdeb.sh and platform/rpm/mkrpm.sh already pass `--prefix=/usr` to ./configure. --- .github/workflows/build-extra.yml | 5 +++-- .github/workflows/build.yml | 5 +++-- .github/workflows/check-c.yml | 3 ++- .github/workflows/test.yml | 25 +++++++++++++++---------- .gitlab-ci.yml | 22 ++++++++++++++++------ platform/rpm/mkrpm.sh | 2 ++ 6 files changed, 41 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-extra.yml b/.github/workflows/build-extra.yml index b0752042de4..e18ab9f0c62 100644 --- a/.github/workflows/build-extra.yml +++ b/.github/workflows/build-extra.yml @@ -63,8 +63,9 @@ jobs: run: ./ci/printenv.sh - name: configure run: > - CC=clang-14 ./configure --enable-fatal-warnings --enable-apparmor - --enable-selinux + ./configure CC=clang-14 + --prefix=/usr --enable-fatal-warnings + --enable-apparmor --enable-selinux || (cat config.log; exit 1) - name: make run: make diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f33670e6357..a005fefd7dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,8 +79,9 @@ jobs: run: ./ci/printenv.sh - name: configure run: > - CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings - --enable-analyzer --enable-apparmor --enable-selinux + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux || (cat config.log; exit 1) - name: make run: make diff --git a/.github/workflows/check-c.yml b/.github/workflows/check-c.yml index dd841c394b1..49c9b38a7b8 100644 --- a/.github/workflows/check-c.yml +++ b/.github/workflows/check-c.yml @@ -68,7 +68,8 @@ jobs: - name: configure run: > ./configure CC=clang-14 SCAN_BUILD=scan-build-14 - --enable-fatal-warnings --enable-apparmor --enable-selinux + --prefix=/usr --enable-fatal-warnings + --enable-apparmor --enable-selinux || (cat config.log; exit 1) - name: scan-build run: make scan-build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3e7153c46dd..f0aeafc9a3d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,8 +73,9 @@ jobs: run: ./ci/printenv.sh - name: configure run: > - CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings - --enable-analyzer --enable-apparmor --enable-selinux + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux || (cat config.log; exit 1) - name: make run: make -j "$(nproc)" @@ -121,8 +122,9 @@ jobs: run: ./ci/printenv.sh - name: configure run: > - CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings - --enable-analyzer --enable-apparmor --enable-selinux + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux || (cat config.log; exit 1) - name: make run: make -j "$(nproc)" @@ -160,8 +162,9 @@ jobs: run: ./ci/printenv.sh - name: configure run: > - CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings - --enable-analyzer --enable-apparmor --enable-selinux + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux || (cat config.log; exit 1) - name: make run: make -j "$(nproc)" @@ -202,8 +205,9 @@ jobs: run: ./ci/printenv.sh - name: configure run: > - CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings - --enable-analyzer --enable-apparmor --enable-selinux + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux || (cat config.log; exit 1) - name: make run: make -j "$(nproc)" @@ -248,8 +252,9 @@ jobs: run: ./ci/printenv.sh - name: configure run: > - CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings - --enable-analyzer --enable-apparmor --enable-selinux + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux || (cat config.log; exit 1) - name: make run: make -j "$(nproc)" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d4ed2dc5ec..71bb70b8250 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,7 +22,8 @@ build_ubuntu_package: | grep -Ev '^(Selecting|Preparing to unpack|Unpacking)' - ./ci/printenv.sh - ./configure || (cat config.log; exit 1) - - make deb + - make dist + - ./mkdeb.sh --enable-fatal-warnings - dpkg -i ./*.deb - make print-version @@ -39,7 +40,8 @@ build_debian_package: | grep -Ev '^(Selecting|Preparing to unpack|Unpacking)' - ./ci/printenv.sh - ./configure || (cat config.log; exit 1) - - make deb + - make dist + - ./mkdeb.sh --enable-fatal-warnings - dpkg -i ./*.deb - make print-version @@ -57,7 +59,9 @@ build_no_apparmor: - ./ci/printenv.sh - ./configure || (cat config.log; exit 1) - make dist - - ./mkdeb.sh --disable-apparmor + - > + ./mkdeb.sh --enable-fatal-warnings + --disable-apparmor - dpkg -i ./*.deb - make print-version - make print-version | grep -F 'AppArmor support is disabled' @@ -70,7 +74,8 @@ build_redhat_package: - dnf install -y rpm-build gcc make - ./ci/printenv.sh - ./configure || (cat config.log; exit 1) - - make rpms + - make dist + - ./platform/rpm/mkrpm.sh --enable-fatal-warnings - rpm -i ./*.rpm - make print-version @@ -82,7 +87,8 @@ build_fedora_package: - dnf install -y rpm-build gcc make - ./ci/printenv.sh - ./configure || (cat config.log; exit 1) - - make rpms + - make dist + - ./platform/rpm/mkrpm.sh --enable-fatal-warnings - rpm -i ./*.rpm - make print-version @@ -94,7 +100,11 @@ build_src_package: - apk upgrade - apk add build-base linux-headers gawk - ./ci/printenv.sh - - ./configure --prefix=/usr || (cat config.log; exit 1) + # Note: Do not use ` --enable-fatal-warnings` because the build + # currently produces warnings on Alpine (see #6224). + - > + ./configure --prefix=/usr + || (cat config.log; exit 1) - make - make install-strip - make print-version diff --git a/platform/rpm/mkrpm.sh b/platform/rpm/mkrpm.sh index 0221fa60757..46bb90036ed 100755 --- a/platform/rpm/mkrpm.sh +++ b/platform/rpm/mkrpm.sh @@ -16,6 +16,8 @@ set -e name="$TARNAME" # Strip any trailing prefix from the version like -rc1 etc version="$(printf '%s\n' "$VERSION" | sed 's/\-.*//g')" + +# Note: rpmbuild itself already passes --prefix=/usr to ./configure config_opt="--disable-userns --disable-contrib-install $*" if [[ ! -f "platform/rpm/${name}.spec" ]]; then