aboutsummaryrefslogtreecommitdiff
path: root/src/nix/log.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-08-17 13:43:39 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-08-17 13:43:39 +0200
commit7cdc739ece681128dd4153e53acb85867accdd1b (patch)
treec6c202a7f596f1077a3b6295344367b937963a5d /src/nix/log.cc
parentbf290c2306d8554b82a9f1d30279b90bf8606fa6 (diff)
parente849b198720c60c186c8f9486c43c495ad436e1b (diff)
Merge remote-tracking branch 'origin/master' into markdown
Diffstat (limited to 'src/nix/log.cc')
-rw-r--r--src/nix/log.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/nix/log.cc b/src/nix/log.cc
index 7e10d373a..33380dcf5 100644
--- a/src/nix/log.cc
+++ b/src/nix/log.cc
@@ -45,11 +45,14 @@ struct CmdLog : InstallableCommand
RunPager pager;
for (auto & sub : subs) {
- auto log = b.drvPath ? sub->getBuildLog(*b.drvPath) : nullptr;
- for (auto & output : b.outputs) {
- if (log) break;
- log = sub->getBuildLog(output.second);
- }
+ auto log = std::visit(overloaded {
+ [&](BuildableOpaque bo) {
+ return sub->getBuildLog(bo.path);
+ },
+ [&](BuildableFromDrv bfd) {
+ return sub->getBuildLog(bfd.drvPath);
+ },
+ }, b);
if (!log) continue;
stopProgressBar();
printInfo("got build log for '%s' from '%s'", installable->what(), sub->getUri());