mirror of
https://github.com/NixOS/nix.git
synced 2025-11-10 20:46:01 +01:00
This changes makes nix detect a machines available cores automatically whenever build-cores is set to 0. So far, nix simply passed NIX_BUILD_CORES=0 whenever build-cores is set to 0. (only when build-cores is unset it was detecting cores automatically) The behavior of passing NIX_BUILD_CORES=0 leads to a performance penalty when sourcing nixpkgs' generic builder's `setup.sh`, as setup.sh has to execute `nproc`. This significantly slows down sourcing of setup.sh
6 lines
379 B
Markdown
6 lines
379 B
Markdown
---
|
|
synopsis: "`build-cores = 0` now auto-detects CPU cores"
|
|
prs: [13402]
|
|
---
|
|
|
|
When `build-cores` is set to `0`, nix now automatically detects the number of available CPU cores and passes this value via `NIX_BUILD_CORES`, instead of passing `0` directly. This matches the behavior when `build-cores` is unset. This prevents the builder from having to detect the number of cores.
|