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 diff --git a/test/compile/compile.sh b/test/compile/compile.sh index 30bfe9e66fa..f3e5c4f33a2 100755 --- a/test/compile/compile.sh +++ b/test/compile/compile.sh @@ -81,7 +81,9 @@ tar -xJvf ../../"$DIST.tar.xz" mv "$DIST" firejail cd firejail || exit 1 -./configure --prefix=/usr --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test1 @@ -98,7 +100,10 @@ rm output-configure output-make print_title "${arr[2]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-dbusproxy --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-dbusproxy \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test2 @@ -115,7 +120,10 @@ rm output-configure output-make print_title "${arr[3]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-chroot \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test3 @@ -132,7 +140,10 @@ rm output-configure output-make print_title "${arr[4]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-firetunnel --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-firetunnel \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test4 @@ -149,7 +160,10 @@ rm output-configure output-make print_title "${arr[5]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-userns \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test5 @@ -167,7 +181,10 @@ rm output-configure output-make print_title "${arr[6]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-network \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test6 @@ -184,7 +201,10 @@ rm output-configure output-make print_title "${arr[7]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-x11 --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-x11 \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test7 @@ -201,7 +221,10 @@ rm output-configure output-make print_title "${arr[8]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --enable-selinux --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --enable-selinux \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test8 @@ -218,7 +241,10 @@ rm output-configure output-make print_title "${arr[9]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-file-transfer --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-file-transfer \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test9 @@ -235,7 +261,10 @@ rm output-configure output-make print_title "${arr[10]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-whitelist --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-whitelist \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test10 @@ -252,7 +281,10 @@ rm output-configure output-make print_title "${arr[11]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-globalcfg --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-globalcfg \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test11 @@ -269,7 +301,10 @@ rm output-configure output-make print_title "${arr[12]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --enable-apparmor \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test12 @@ -286,7 +321,10 @@ rm output-configure output-make print_title "${arr[13]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --enable-busybox-workaround --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --enable-busybox-workaround \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test13 @@ -303,7 +341,10 @@ rm output-configure output-make print_title "${arr[14]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-overlayfs --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-overlayfs \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test14 @@ -320,7 +361,10 @@ rm output-configure output-make print_title "${arr[15]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-private-home \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test15 @@ -337,7 +381,10 @@ rm output-configure output-make print_title "${arr[16]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-man --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-man \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test16 @@ -354,7 +401,10 @@ rm output-configure output-make print_title "${arr[17]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-usertmpfs --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-usertmpfs \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test17 @@ -371,7 +421,10 @@ rm output-configure output-make print_title "${arr[18]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-private-home \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test18 @@ -388,7 +441,10 @@ rm output-configure output-make print_title "${arr[19]}" cd firejail || exit 1 make distclean -./configure --prefix=/usr --enable-ids --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-fatal-warnings \ + --enable-ids \ + 2>&1 | tee ../output-configure + make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test19