Skip to content

Commit

Permalink
build: standardize ./configure arguments
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kmk3 committed Feb 29, 2024
1 parent 93a5d7a commit 2301ab2
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 40 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/check-c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 15 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -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)"
Expand Down Expand Up @@ -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)"
Expand Down Expand Up @@ -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)"
Expand Down Expand Up @@ -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)"
Expand Down
22 changes: 16 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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'
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions platform/rpm/mkrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
94 changes: 75 additions & 19 deletions test/compile/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2301ab2

Please sign in to comment.