aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-04-05 18:30:02 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-04-05 18:40:30 -0400
commitd5cef6c33a051dfc672cb1e5f4739948b167315b (patch)
tree256fb271fa069106186c5c89214db03acf81a673 /src/libexpr
parente12308dd63f0ad27b22dcdb3da89c411eebcad2b (diff)
parent9dfb97c987d8b9d6a3d15f016e40f22f91deb764 (diff)
Merge commit '9dfb97c987d8b9d6a3d15f016e40f22f91deb764' into path-info
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/get-drvs.cc3
-rw-r--r--src/libexpr/primops.cc12
2 files changed, 9 insertions, 6 deletions
diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc
index 1a3990ea1..f774e6493 100644
--- a/src/libexpr/get-drvs.cc
+++ b/src/libexpr/get-drvs.cc
@@ -2,6 +2,7 @@
#include "util.hh"
#include "eval-inline.hh"
#include "store-api.hh"
+#include "path-with-outputs.hh"
#include <cstring>
#include <regex>
@@ -19,7 +20,7 @@ DrvInfo::DrvInfo(EvalState & state, const string & attrPath, Bindings * attrs)
DrvInfo::DrvInfo(EvalState & state, ref<Store> store, const std::string & drvPathWithOutputs)
: state(&state), attrs(nullptr), attrPath("")
{
- auto [drvPath, selectedOutputs] = store->parsePathWithOutputs(drvPathWithOutputs);
+ auto [drvPath, selectedOutputs] = parsePathWithOutputs(*store, drvPathWithOutputs);
this->drvPath = store->printStorePath(drvPath);
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 1a5168191..0f5267083 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -35,7 +35,7 @@ InvalidPathError::InvalidPathError(const Path & path) :
void EvalState::realiseContext(const PathSet & context)
{
- std::vector<StorePathWithOutputs> drvs;
+ std::vector<BuildableReqFromDrv> drvs;
for (auto & i : context) {
auto [ctxS, outputName] = decodeContext(i);
@@ -43,7 +43,7 @@ void EvalState::realiseContext(const PathSet & context)
if (!store->isValidPath(ctx))
throw InvalidPathError(store->printStorePath(ctx));
if (!outputName.empty() && ctx.isDerivation()) {
- drvs.push_back(StorePathWithOutputs{ctx, {outputName}});
+ drvs.push_back({ctx, {outputName}});
}
}
@@ -51,14 +51,16 @@ void EvalState::realiseContext(const PathSet & context)
if (!evalSettings.enableImportFromDerivation)
throw EvalError("attempted to realize '%1%' during evaluation but 'allow-import-from-derivation' is false",
- store->printStorePath(drvs.begin()->path));
+ store->printStorePath(drvs.begin()->drvPath));
/* For performance, prefetch all substitute info. */
StorePathSet willBuild, willSubstitute, unknown;
uint64_t downloadSize, narSize;
- store->queryMissing(drvs, willBuild, willSubstitute, unknown, downloadSize, narSize);
+ std::vector<BuildableReq> buildReqs;
+ for (auto & d : drvs) buildReqs.emplace_back(BuildableReq { d });
+ store->queryMissing(buildReqs, willBuild, willSubstitute, unknown, downloadSize, narSize);
- store->buildPaths(drvs);
+ store->buildPaths(buildReqs);
/* Add the output of this derivations to the allowed
paths. */