diff options
author | Tanguy <tanguy@status.im> | 2023-05-11 16:50:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-11 16:50:18 +0200 |
commit | c00448358121bbf6b5e1fcfe39bb6eb3359d6462 (patch) | |
tree | e47993297bc4833bd126a143a93f644b79c95aba | |
parent | f7ed293fbd84bf0350fbfee78e634b5f401f5b0a (diff) | |
download | Nim-c00448358121bbf6b5e1fcfe39bb6eb3359d6462.tar.gz |
Bootstrap: Allow to override number of CPUs (#21823)
* Allow to override number of cpu * NCPU -> NIMCORES
-rw-r--r-- | ci/funs.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ci/funs.sh b/ci/funs.sh index 8e7f8faf7..026366198 100644 --- a/ci/funs.sh +++ b/ci/funs.sh @@ -58,7 +58,11 @@ _nimNumCpu(){ # FreeBSD | macOS: $(sysctl -n hw.ncpu) # OpenBSD: $(sysctl -n hw.ncpuonline) # windows: $NUMBER_OF_PROCESSORS ? - echo $(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || 1) + if env | grep -q '^NIMCORES='; then + echo $NIMCORES + else + echo $(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || 1) + fi } _nimBuildCsourcesIfNeeded(){ |