Skip to content

Commit f2df11a

Browse files
authored
ci: make all main make steps parallel and sync output (#7162)
Changes: * Use `scan-build make` instead of running `scan-build` inside of `make` (this appears to be necessary for the output synchronization to work) * Use `-j "$(nproc)"` and `-Orecurse` for the main `make` step in all jobs (including where this step is currently not parallel) The main drawback of using parallel make (`-j`) is that the output of different jobs may be printed interspersed, which makes the output harder to read and less stable across multiple executions. Example: job1: line1 job1: line2 job2: line1 job3: line1 job1: line3 Using `-Orecurse` should fix this by ensuring that the output of all jobs is still printed sequentially in the order that the jobs were executed (that is, as if `-j` was not used), even if the jobs themselves are executed in parallel. This should ensure that the main `make` step in each job runs its targets in parallel and has a stable output at the same time, making it easier to compare the logs of the same job across different CI runs. Note: The `-O` flag is specific to GNU make and was added in version 4.0 (2013-10-09). Related commits: * 500d8f2 ("ci: run make in parallel where applicable", 2023-08-14) / PR #5960 * 1f6400b ("build: sync scan-build target with CI", 2024-02-24) / PR #6222
1 parent fce18b9 commit f2df11a

5 files changed

Lines changed: 26 additions & 18 deletions

File tree

.github/workflows/build-extra.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
--enable-apparmor --enable-selinux
6969
|| (cat config.log; exit 1)
7070
- name: make
71-
run: make
71+
run: make -j "$(nproc)" -Orecurse
7272
- name: make install
7373
run: sudo make install
7474
- name: make installcheck
@@ -103,7 +103,7 @@ jobs:
103103
--enable-apparmor --enable-selinux
104104
|| (cat config.log; exit 1)
105105
- name: make
106-
run: make
106+
run: make -j "$(nproc)" -Orecurse
107107
- name: make install
108108
run: sudo make install
109109
- name: make installcheck

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
--disable-apparmor --disable-selinux
7474
|| (cat config.log; exit 1)
7575
- name: make
76-
run: make -j "$(nproc)"
76+
run: make -j "$(nproc)" -Orecurse
7777
- name: make install
7878
run: sudo make install
7979
- name: make installcheck

.github/workflows/check-c.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ jobs:
6767
run: ./ci/printenv.sh
6868
- name: configure
6969
run: >
70-
./configure CC=clang-14 SCAN_BUILD=scan-build-14
70+
./configure CC=clang-14
7171
--prefix=/usr --enable-fatal-warnings
7272
--enable-apparmor --enable-selinux
7373
|| (cat config.log; exit 1)
7474
- name: scan-build
75-
run: make -j "$(nproc)" scan-build
75+
run: scan-build-14 make -j "$(nproc)" -Orecurse
7676

7777
cppcheck:
7878
runs-on: ubuntu-24.04
@@ -139,7 +139,7 @@ jobs:
139139
run: ./configure || (cat config.log; exit 1)
140140

141141
- name: make
142-
run: make -j "$(nproc)"
142+
run: make -j "$(nproc)" -Orecurse
143143

144144
- name: Perform CodeQL Analysis
145145
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
--enable-apparmor --enable-selinux
7979
|| (cat config.log; exit 1)
8080
- name: make
81-
run: make -j "$(nproc)"
81+
run: make -j "$(nproc)" -Orecurse
8282
- name: make install
8383
run: sudo make install
8484
- name: make installcheck
@@ -127,7 +127,7 @@ jobs:
127127
--enable-apparmor --enable-selinux
128128
|| (cat config.log; exit 1)
129129
- name: make
130-
run: make -j "$(nproc)"
130+
run: make -j "$(nproc)" -Orecurse
131131
- name: make install
132132
run: sudo make install
133133
- name: make installcheck
@@ -168,7 +168,7 @@ jobs:
168168
--enable-apparmor --enable-selinux
169169
|| (cat config.log; exit 1)
170170
- name: make
171-
run: make -j "$(nproc)"
171+
run: make -j "$(nproc)" -Orecurse
172172
- name: make install
173173
run: sudo make install
174174
- name: make installcheck
@@ -211,7 +211,7 @@ jobs:
211211
--enable-apparmor --enable-selinux
212212
|| (cat config.log; exit 1)
213213
- name: make
214-
run: make -j "$(nproc)"
214+
run: make -j "$(nproc)" -Orecurse
215215
- name: make install
216216
run: sudo make install
217217
- name: make installcheck
@@ -258,7 +258,7 @@ jobs:
258258
--enable-apparmor --enable-selinux
259259
|| (cat config.log; exit 1)
260260
- name: make
261-
run: make -j "$(nproc)"
261+
run: make -j "$(nproc)" -Orecurse
262262
- name: make install
263263
run: sudo make install
264264
- name: make installcheck

.gitlab-ci.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ build_ubuntu_package:
2323
- ./ci/printenv.sh
2424
- ./configure || (cat config.log; exit 1)
2525
- make dist
26-
- ./mkdeb.sh --enable-fatal-warnings
26+
- >
27+
MAKEFLAGS="$MAKEFLAGS -Orecurse" ./mkdeb.sh
28+
--enable-fatal-warnings
2729
- dpkg -i ./*.deb
2830
- make installcheck
2931

@@ -41,7 +43,9 @@ build_debian_package:
4143
- ./ci/printenv.sh
4244
- ./configure || (cat config.log; exit 1)
4345
- make dist
44-
- ./mkdeb.sh --enable-fatal-warnings
46+
- >
47+
MAKEFLAGS="$MAKEFLAGS -Orecurse" ./mkdeb.sh
48+
--enable-fatal-warnings
4549
- dpkg -i ./*.deb
4650
- make installcheck
4751

@@ -60,8 +64,8 @@ build_no_apparmor:
6064
- ./configure || (cat config.log; exit 1)
6165
- make dist
6266
- >
63-
./mkdeb.sh --enable-fatal-warnings
64-
--disable-apparmor
67+
MAKEFLAGS="$MAKEFLAGS -Orecurse" ./mkdeb.sh
68+
--enable-fatal-warnings --disable-apparmor
6569
- dpkg -i ./*.deb
6670
- make installcheck
6771
- make installcheck | grep -F 'AppArmor support is disabled'
@@ -75,7 +79,9 @@ build_redhat_package:
7579
- ./ci/printenv.sh
7680
- ./configure || (cat config.log; exit 1)
7781
- make dist
78-
- ./platform/rpm/mkrpm.sh --enable-fatal-warnings
82+
- >
83+
MAKEFLAGS="$MAKEFLAGS -Orecurse" ./platform/rpm/mkrpm.sh
84+
--enable-fatal-warnings
7985
- rpm -i ./*.rpm
8086
- make installcheck
8187

@@ -88,7 +94,9 @@ build_fedora_package:
8894
- ./ci/printenv.sh
8995
- ./configure || (cat config.log; exit 1)
9096
- make dist
91-
- ./platform/rpm/mkrpm.sh --enable-fatal-warnings
97+
- >
98+
MAKEFLAGS="$MAKEFLAGS -Orecurse" ./platform/rpm/mkrpm.sh
99+
--enable-fatal-warnings
92100
- rpm -i ./*.rpm
93101
- make installcheck
94102

@@ -106,7 +114,7 @@ build_fedora_package:
106114
# - >
107115
# ./configure --prefix=/usr
108116
# || (cat config.log; exit 1)
109-
# - make
117+
# - make -j "$(nproc)" -Orecurse
110118
# - make install-strip
111119
# - make installcheck
112120

0 commit comments

Comments
 (0)