diff options
author | Peter Simons <simons@cryp.to> | 2010-06-23T14·34+0000 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2010-06-23T14·34+0000 |
commit | 8b7f8b56f11145c1be5188113cbcdbea27e99525 (patch) | |
tree | 06e342b8801860283f115e38a9cbafa2394f957e /src/libstore/globals.cc | |
parent | 819548d92f45d8aea671ca9a3e938ff928679063 (diff) |
Added support for passing an (impure) NIX_BUILD_CORES variable to build expressions.
This patch adds the configuration file variable "build-cores" and the command line argument "--cores". These settings specify the number of CPU cores to utilize for parallel building within a job, i.e. by passing an appropriate "-j" flag to GNU Make. The default value is 1, which means that parallel building is *disabled*. If the number of build cores is specified as 0 (synonymously: "guess" or "auto"), then the actual value is supposed to be auto-detected by builders at run-time, i.e by calling the nproc(1) utility from coreutils. The environment variable $NIX_BUILD_CORES is available to builders, but the contents of that variable does *not* influence the hash that goes into the $out store path, i.e. the number of build cores to be utilized can be changed at will without requiring any re-builds.
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r-- | src/libstore/globals.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index cc0e44e8e34e..75d2f69c2b72 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -22,6 +22,7 @@ bool keepGoing = false; bool tryFallback = false; Verbosity buildVerbosity = lvlInfo; unsigned int maxBuildJobs = 1; +unsigned int buildCores = 1; bool readOnlyMode = false; string thisSystem = "unset"; time_t maxSilentTime = 0; |