1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-19 00:39:37 +01:00

Merge pull request #13402 from DavHau/build-cores

build-cores: detect cores automatically if set to 0
This commit is contained in:
Sergei Zimmerman 2025-07-09 23:06:55 +03:00 committed by GitHub
commit b19e9acc03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 58 additions and 10 deletions

View file

@ -535,7 +535,7 @@ static void main_nix_build(int argc, char * * argv)
env["NIX_BUILD_TOP"] = env["TMPDIR"] = env["TEMPDIR"] = env["TMP"] = env["TEMP"] = tmpDir.path().string();
env["NIX_STORE"] = store->storeDir;
env["NIX_BUILD_CORES"] = std::to_string(settings.buildCores);
env["NIX_BUILD_CORES"] = fmt("%d", settings.buildCores ? settings.buildCores : settings.getDefaultCores());
auto parsedDrv = StructuredAttrs::tryParse(drv.env);
DerivationOptions drvOptions;