aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-08-04 17:48:29 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-08-04 17:48:29 +0000
commit587dc8aa003cc5f676cc7d01b4fea984f5033107 (patch)
tree0b04f6705e122f54aa3c7bd25103b8eddebd6a58 /src/libstore/build.cc
parentfd9c77dfc7b90d447e6bfdb4f0d5b521184aeddb (diff)
parent750be19ae865da3ee03c132a287148f2402ad72b (diff)
* Sync with the trunk.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 5818aa51d..6f0276244 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
+#include <cstring>
#include <pwd.h>
#include <grp.h>
@@ -1427,6 +1428,9 @@ void DerivationGoal::startBuilder()
in the store or in the build directory). */
env["NIX_STORE"] = nixStore;
+ /* The maximum number of cores to utilize for parallel building. */
+ env["NIX_BUILD_CORES"] = (format("%d") % buildCores).str();
+
/* Add all bindings specified in the derivation. */
foreach (StringPairs::iterator, i, drv.env)
env[i->first] = i->second;
@@ -2654,6 +2658,7 @@ void Worker::waitForInput()
timeout.tv_sec = std::max((time_t) 0, lastWokenUp + wakeUpInterval - before);
} else lastWokenUp = 0;
+ using namespace std;
/* Use select() to wait for the input side of any logger pipe to
become `available'. Note that `available' (i.e., non-blocking)
includes EOF. */