aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcmd')
-rw-r--r--src/libcmd/installables.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index d1ed19acf..b7623d4ba 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -826,15 +826,17 @@ BuiltPaths Installable::build(
for (auto & buildResult : store->buildPathsWithResults(pathsToBuild, bMode, evalStore)) {
if (!buildResult.success())
buildResult.rethrow();
- if (buildResult.drvPath) {
- std::map<std::string, StorePath> outputs;
- for (auto & path : buildResult.builtOutputs)
- outputs.emplace(path.first.outputName, path.second.outPath);
- res.push_back(BuiltPath::Built{*buildResult.drvPath, outputs});
- } else if (buildResult.outPath) {
- res.push_back(BuiltPath::Opaque{*buildResult.outPath});
- } else
- abort();
+ std::visit(overloaded {
+ [&](const DerivedPath::Built & bfd) {
+ std::map<std::string, StorePath> outputs;
+ for (auto & path : buildResult.builtOutputs)
+ outputs.emplace(path.first.outputName, path.second.outPath);
+ res.push_back(BuiltPath::Built { bfd.drvPath, outputs });
+ },
+ [&](const DerivedPath::Opaque & bo) {
+ res.push_back(BuiltPath::Opaque { bo.path });
+ },
+ }, buildResult.path.raw());
}
return res;
}