aboutsummaryrefslogtreecommitdiff
path: root/src/nix-instantiate/nix-instantiate.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-instantiate/nix-instantiate.cc')
-rw-r--r--src/nix-instantiate/nix-instantiate.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index a08683be1..3ec0e6e7c 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -61,12 +61,13 @@ void processExpr(EvalState & state, const Strings & attrPaths,
DrvInfos drvs;
getDerivations(state, v, "", autoArgs, drvs, false);
for (auto & i : drvs) {
- Path drvPath = i.queryDrvPath();
+ auto drvPath = i.requireDrvPath();
+ auto drvPathS = state.store->printStorePath(drvPath);
/* What output do we want? */
- string outputName = i.queryOutputName();
+ std::string outputName = i.queryOutputName();
if (outputName == "")
- throw Error("derivation '%1%' lacks an 'outputName' attribute ", drvPath);
+ throw Error("derivation '%1%' lacks an 'outputName' attribute", drvPathS);
if (gcRoot == "")
printGCWarning();
@@ -75,9 +76,9 @@ void processExpr(EvalState & state, const Strings & attrPaths,
if (++rootNr > 1) rootName += "-" + std::to_string(rootNr);
auto store2 = state.store.dynamic_pointer_cast<LocalFSStore>();
if (store2)
- drvPath = store2->addPermRoot(store2->parseStorePath(drvPath), rootName);
+ drvPathS = store2->addPermRoot(drvPath, rootName);
}
- std::cout << fmt("%s%s\n", drvPath, (outputName != "out" ? "!" + outputName : ""));
+ std::cout << fmt("%s%s\n", drvPathS, (outputName != "out" ? "!" + outputName : ""));
}
}
}