Skip to content
Open
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
18 changes: 13 additions & 5 deletions util/run-gnu-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,20 @@ echo "path_UUTILS='${path_UUTILS}'"
echo "path_GNU='${path_GNU}'"

# Use GNU nproc for *BSD
NPROC_BIN=$(command -v "${path_GNU}"/src/nproc||command -v nproc)
# `-j` wants a job count: handing it the path to nproc made make read it as a
# (bogus) goal and run with unlimited parallelism, which starves the CI runner.
NPROC=$("${NPROC_BIN}" 2>/dev/null) || NPROC=1
MAKEFLAGS="${MAKEFLAGS} -j ${NPROC}"
if NPROC_COMMAND=$(command -v "${path_GNU}/src/nproc" || command -v nproc); then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to assume missing nproc binary as we use GNU's one.

JOBS=$("${NPROC_COMMAND}")
else
JOBS=2
fi
case "${JOBS}" in

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Believe existing nproc and remove this if block.

'' | 0* | *[!0-9]*)
echo "Error: invalid make job count: '${JOBS}'" >&2
exit 1
;;
esac
MAKEFLAGS="${MAKEFLAGS:+${MAKEFLAGS} }-j${JOBS}"
export MAKEFLAGS
echo "GNU test make job count: ${JOBS}"
Comment on lines +42 to +44
###

cd "${path_GNU}" && echo "[ pwd:'${PWD}' ]"
Expand Down
Loading