From 16649a99898b2739f4eb313ec156f3218809da20 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 17 Apr 2025 19:30:58 -0400 Subject: configure: Work around a Bash 3 bug Before Bash 4, the `command` builtin did not work properly in AND-OR lists when set -e was active, leading to set -e command nonesuch || echo none failing without echoing. Work around it by runing `command nproc` in a subshell. Link: https://stackoverflow.com/q/68143965 --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 1842078..ab62aa6 100755 --- a/configure +++ b/configure @@ -87,7 +87,9 @@ invalid() { # Get the number of cores to use nproc() { { - command nproc \ + # Run command nproc in a subshell to work around a bash 3 bug + # https://stackoverflow.com/q/68143965 + (command nproc) \ || sysctl -n hw.ncpu \ || getconf _NPROCESSORS_ONLN \ || echo 1 -- cgit v1.2.3