[llvm] test-release.sh: Default to letting ninja select the number of build jobs (PR #73187)
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 22 16:28:21 PST 2023
https://github.com/tstellar created https://github.com/llvm/llvm-project/pull/73187
ninja defaults to using ncpus + 2 build jobs, and this extra parallelism helps the script complete faster in my testing on the GitHub runners.
>From 49b3e2162ea284d589211346e5d05a4a147cd4be Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 21 Nov 2023 17:28:04 -0800
Subject: [PATCH] test-release.sh: Default to letting ninja select the number
of build jobs
ninja defaults to using ncpus + 2 build jobs, and this extra parallelism
helps the script complete faster in my testing on the GitHub runners.
---
llvm/utils/release/test-release.sh | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/llvm/utils/release/test-release.sh b/llvm/utils/release/test-release.sh
index 63bf3974a987d20..f38134e3d22d8f5 100755
--- a/llvm/utils/release/test-release.sh
+++ b/llvm/utils/release/test-release.sh
@@ -246,6 +246,8 @@ if [ "$Release" != "test" ]; then
fi
fi
+UserNumJobs="$NumJobs"
+
# Figure out how many make processes to run.
if [ -z "$NumJobs" ]; then
NumJobs=`sysctl -n hw.activecpu 2> /dev/null || true`
@@ -260,6 +262,13 @@ if [ -z "$NumJobs" ]; then
NumJobs=3
fi
+if [ "$MAKE" = "ninja" ] && [ -z "$UserNumJobs" ]; then
+ # Rely on default ninja job numbers
+ J_ARG=""
+else
+ J_ARG="-j $NumJobs"
+fi
+
# Projects list
projects="llvm;clang"
if [ $do_clang_tools = "yes" ]; then
@@ -484,8 +493,8 @@ function build_llvmCore() {
cd $ObjDir
echo "# Compiling llvm $Release-$RC $Flavor"
- echo "# ${MAKE} -j $NumJobs $Verbose"
- ${MAKE} -j $NumJobs $Verbose $BuildTarget \
+ echo "# ${MAKE} $J_ARG $Verbose"
+ ${MAKE} $J_ARG $Verbose $BuildTarget \
2>&1 | tee $LogDir/llvm.make-Phase$Phase-$Flavor.log > $redir
echo "# Installing llvm $Release-$RC $Flavor"
@@ -508,7 +517,7 @@ function test_llvmCore() {
fi
cd $ObjDir
- if ! ( ${MAKE} -j $NumJobs $KeepGoing $Verbose check-all \
+ if ! ( ${MAKE} $J_ARG $KeepGoing $Verbose check-all \
2>&1 | tee $LogDir/llvm.check-Phase$Phase-$Flavor.log ) ; then
deferred_error $Phase $Flavor "check-all failed"
fi
@@ -519,7 +528,7 @@ function test_llvmCore() {
cmake $TestSuiteSrcDir -G "$generator" -DTEST_SUITE_LIT=$Lit \
-DTEST_SUITE_HOST_CC=$build_compiler
- if ! ( ${MAKE} -j $NumJobs $KeepGoing $Verbose check \
+ if ! ( ${MAKE} $J_ARG $KeepGoing $Verbose check \
2>&1 | tee $LogDir/llvm.check-Phase$Phase-$Flavor.log ) ; then
deferred_error $Phase $Flavor "test suite failed"
fi
More information about the llvm-commits
mailing list