Skip to content

Commit

Permalink
ci: 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 58733d5 commit 3309314
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 21 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

0 comments on commit 3309314

Please sign in to comment.