From c7654bc491d9ce7c1fbadecd7769418fa79a2060 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 28 Jul 2017 15:03:59 +0200 Subject: [PATCH] nix-build: Fix regression causing all outputs to be built --- src/nix-build/nix-build.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc index 8a3c8a025..769ca8cd0 100755 --- a/src/nix-build/nix-build.cc +++ b/src/nix-build/nix-build.cc @@ -453,13 +453,13 @@ void mainWrapped(int argc, char * * argv) for (auto & drvInfo : drvs) { auto drvPath = drvInfo.queryDrvPath(); - pathsToBuild.insert(drvPath); + auto outPath = drvInfo.queryOutPath(); auto outputName = drvInfo.queryOutputName(); if (outputName == "") throw Error("derivation ‘%s’ lacks an ‘outputName’ attribute", drvPath); - pathsToBuild.insert(drvPath + (outputName != "out" ? "!" + outputName : "")); + pathsToBuild.insert(drvPath + "!" + outputName); std::string drvPrefix; auto i = drvPrefixes.find(drvPath); @@ -475,8 +475,8 @@ void mainWrapped(int argc, char * * argv) std::string symlink = drvPrefix; if (outputName != "out") symlink += "-" + outputName; - resultSymlinks[symlink] = drvInfo.queryOutPath(); - outPaths.push_back(drvInfo.queryOutPath()); + resultSymlinks[symlink] = outPath; + outPaths.push_back(outPath); } buildPaths(pathsToBuild);