aboutsummaryrefslogtreecommitdiff
path: root/src/nix-build/nix-build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-build/nix-build.cc')
-rwxr-xr-xsrc/nix-build/nix-build.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc
index 65b85b304..3fec2c06c 100755
--- a/src/nix-build/nix-build.cc
+++ b/src/nix-build/nix-build.cc
@@ -12,6 +12,7 @@
#include "affinity.hh"
#include "util.hh"
#include "shared.hh"
+#include "path-with-outputs.hh"
#include "eval.hh"
#include "eval-inline.hh"
#include "get-drvs.hh"
@@ -321,7 +322,8 @@ static void main_nix_build(int argc, char * * argv)
state->printStats();
- auto buildPaths = [&](const std::vector<StorePathWithOutputs> & paths) {
+ auto buildPaths = [&](const std::vector<StorePathWithOutputs> & paths0) {
+ auto paths = toDerivedPaths(paths0);
/* Note: we do this even when !printMissing to efficiently
fetch binary cache data. */
uint64_t downloadSize, narSize;
@@ -385,6 +387,12 @@ static void main_nix_build(int argc, char * * argv)
if (dryRun) return;
+ if (settings.isExperimentalFeatureEnabled("ca-derivations")) {
+ auto resolvedDrv = drv.tryResolve(*store);
+ assert(resolvedDrv && "Successfully resolved the derivation");
+ drv = *resolvedDrv;
+ }
+
// Set the environment.
auto env = getEnv();
@@ -420,8 +428,6 @@ static void main_nix_build(int argc, char * * argv)
} else
env[var.first] = var.second;
- restoreAffinity();
-
/* Run a shell using the derivation's environment. For
convenience, source $stdenv/setup to setup additional
environment variables and shell functions. Also don't
@@ -471,7 +477,7 @@ static void main_nix_build(int argc, char * * argv)
auto argPtrs = stringsToCharPtrs(args);
- restoreSignals();
+ restoreProcessContext();
logger->stop();