summary refs log tree commit diff stats
path: root/build_all.sh
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2020-02-03 02:02:44 +0100
committerGitHub <noreply@github.com>2020-02-03 02:02:44 +0100
commit1ab37ccfc604ed108886a0eed63707c3be17b67d (patch)
tree4e3a24c9633167b1324a90fe0bbd4a028fa8234d /build_all.sh
parentdfecc3489bc7caa515c1920a58c3ae013a768618 (diff)
downloadNim-1ab37ccfc604ed108886a0eed63707c3be17b67d.tar.gz
Make build_all.sh more portable and a bit simpler (#13308)
Diffstat (limited to 'build_all.sh')
-rw-r--r--build_all.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/build_all.sh b/build_all.sh
index 2af7f14ee..9c5aa3d91 100644
--- a/build_all.sh
+++ b/build_all.sh
@@ -7,7 +7,7 @@ set -u # error on undefined variables
 set -e # exit on first error
 
 echo_run(){
-  printf "\n$*\n"
+  echo "$*"
   "$@"
 }
 
@@ -21,7 +21,7 @@ build_nim_csources_via_script(){
 }
 
 build_nim_csources(){
-  ## avoid changing dir in case of failure
+  # avoid changing dir in case of failure
   (
     if [[ $# -ne 0 ]]; then
       # some args were passed (eg: `--cpu i386`), need to call build.sh
@@ -33,10 +33,7 @@ build_nim_csources(){
       if [ "$unamestr" = 'FreeBSD' ]; then
         makeX=gmake
       fi
-      # see https://stackoverflow.com/a/53427092/1426932
-      logicalCpus=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
-      # +1: see https://unix.stackexchange.com/questions/519092/what-is-the-logic-of-using-nproc-1-in-make-command
-      which $makeX && echo_run $makeX -C csources -j $(($logicalCpus + 1)) || build_nim_csources_via_script
+      which $makeX && echo_run $makeX -C csources -j -l 80 || build_nim_csources_via_script
     fi
   )
   # keep $nim_csources in case needed to investigate bootstrap issues