Skip to content

Commit 437bf5a

Browse files
authored
Merge pull request #10315 from 9999years/validate-jobs-nproc
validate.sh: `--jobs` should default to `nproc`
2 parents db167ca + 00c9b65 commit 437bf5a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

validate.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See https://github.com/haskell/cabal/issues/8049
1313
HC=ghc
1414
CABAL=cabal
15-
JOBS=4
15+
JOBS=""
1616
LIBTESTS=true
1717
CLITESTS=true
1818
CABALSUITETESTS=true
@@ -293,6 +293,15 @@ fi
293293
# Adjust runtime configuration
294294
#######################################################################
295295

296+
if [ -z "$JOBS" ]; then
297+
if command -v nproc >/dev/null; then
298+
JOBS=$(nproc)
299+
else
300+
echo "Warning: \`nproc\` not found, setting \`--jobs\` to default of 4."
301+
JOBS=4
302+
fi
303+
fi
304+
296305
TESTSUITEJOBS="-j$JOBS"
297306
JOBS="-j$JOBS"
298307

0 commit comments

Comments
 (0)