aboutsummaryrefslogtreecommitdiff
path: root/src/nix/log.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-18 14:36:44 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-18 14:36:44 +0000
commit950ddfdb823891136043ae22dce0c66424c57b9d (patch)
tree0c7adf760042911b5631125a22fc8d53fe19ca0d /src/nix/log.cc
parent9357512d7379337c3636fa495ad7b4bbe3d8266d (diff)
parent1c8b550e34414d0f4cb0fa20322a2dfe06ce2de0 (diff)
Merge remote-tracking branch 'upstream/master' into derivation-header-include-order
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());