From: Willy Tarreau Date: Mon, 27 May 2024 09:59:46 +0000 (+0200) Subject: CI: scripts: build vtest using multiple CPUs X-Git-Tag: v3.0.0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e943cdf2733387b408d489e0d31542dfd362ff6;p=thirdparty%2Fhaproxy.git CI: scripts: build vtest using multiple CPUs Now that vtest supports make -j, let's use it to save a bit of time (the build time is ~6s per test by default). --- diff --git a/scripts/build-vtest.sh b/scripts/build-vtest.sh index e77a9e9311..9ae43068ec 100755 --- a/scripts/build-vtest.sh +++ b/scripts/build-vtest.sh @@ -15,11 +15,16 @@ tar xvf VTest.tar.gz -C ../vtest --strip-components=1 cd ../vtest +set +e +CPUS=${CPUS:-$(nproc 2>/dev/null)} +CPUS=${CPUS:-1} +set -e + # # temporarily detect Apple Silicon (it's using /opt/homebrew instead of /usr/local) # if test -f /opt/homebrew/include/pcre2.h; then - make FLAGS="-O2 -s -Wall" INCS="-Isrc -Ilib -I/usr/local/include -I/opt/homebrew/include -pthread" + make -j${CPUS} FLAGS="-O2 -s -Wall" INCS="-Isrc -Ilib -I/usr/local/include -I/opt/homebrew/include -pthread" else - make FLAGS="-O2 -s -Wall" + make -j${CPUS} FLAGS="-O2 -s -Wall" fi