From c78130b15d250ead410e60bb3b32c696c0deb8b0 Mon Sep 17 00:00:00 2001 From: Johannes Kimmel Date: Mon, 11 Jan 2021 08:36:02 +0100 Subject: [PATCH] buildscript: count available cpus with nproc Grepping `/proc/cpuinfo` does not yield the correct number of available cpus when running in a docker container or setting the number of available cpus with taskset. ``` $ taskset 1 grep -c processor /proc/cpuinfo 8 $ taskset 1 nproc 1 ``` This will prevent using too many build jobs on environments where the number of available cpus is reduced. `nproc` is part of `coreutils`. Signed-off-by: Johannes Kimmel --- buildscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildscript b/buildscript index 81ae501..2108ad0 100755 --- a/buildscript +++ b/buildscript @@ -230,7 +230,7 @@ build() { opath=$(pwd) cd "$builddir" - cpus=$(grep -c processor /proc/cpuinfo) + cpus=$(nproc) case "$1" in "debug")