Skip to content

Commit

Permalink
Try to fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbauer committed Jan 30, 2021
1 parent 1012ab2 commit 86b65fc
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/libcmd/command.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,24 @@ void StorePathsCommand::run(ref<Store> store)
storePaths.push_back(p);

if (recursive) {
if (includeBuildRefs)
for (auto & i : installables)
if (includeBuildRefs) {
for (auto & i : installables) {
for (auto & b : i->toBuildables()) {
if (!b.drvPath) {
auto info = store->queryPathInfo(b.outputs.at("out"));
if (info->deriver)
storePaths.push_back(*info->deriver);
else
throw UsageError("Cannot find build references for '%s' without a derivation path", b.what());
} else
storePaths.push_back(*b.drvPath);
std::visit(overloaded {
[&](BuildableOpaque bo) {
auto info = store->queryPathInfo(bo.path);
if (info->deriver)
storePaths.push_back(*info->deriver);
else
throw UsageError("Cannot find build references for '%s' without a derivation path", store->printStorePath(bo.path));
},
[&](BuildableFromDrv bfd) {
storePaths.push_back(bfd.drvPath);
},
}, b);
}
}
}

StorePathSet closure;
store->computeFSClosure(StorePathSet(storePaths.begin(), storePaths.end()), closure, false, includeBuildRefs);
Expand Down

0 comments on commit 86b65fc

Please sign in to comment.