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.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc
index 361f9730d..65b85b304 100755
--- a/src/nix-build/nix-build.cc
+++ b/src/nix-build/nix-build.cc
@@ -240,8 +240,6 @@ static void main_nix_build(int argc, char * * argv)
myArgs.parseCmdline(args);
- initPlugins();
-
if (packages && fromArgs)
throw UsageError("'-p' and '-E' are mutually exclusive");
@@ -449,6 +447,7 @@ static void main_nix_build(int argc, char * * argv)
"unset NIX_ENFORCE_PURITY; "
"shopt -u nullglob; "
"unset TZ; %6%"
+ "shopt -s execfail;"
"%7%",
shellEscape(tmpDir),
(pure ? "" : "p=$PATH; "),
@@ -518,9 +517,11 @@ static void main_nix_build(int argc, char * * argv)
if (counter)
drvPrefix += fmt("-%d", counter + 1);
- auto builtOutputs = store->queryDerivationOutputMap(drvPath);
+ auto builtOutputs = store->queryPartialDerivationOutputMap(drvPath);
- auto outputPath = builtOutputs.at(outputName);
+ auto maybeOutputPath = builtOutputs.at(outputName);
+ assert(maybeOutputPath);
+ auto outputPath = *maybeOutputPath;
if (auto store2 = store.dynamic_pointer_cast<LocalFSStore>()) {
std::string symlink = drvPrefix;