Skip to content

test-release.sh: Default to letting ninja select the number of build jobs #73187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions llvm/utils/release/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down