aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-08 18:20:39 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-11 13:32:16 +0000
commit678d1c2aa0f499466c723d3461277dc197515f57 (patch)
treed724d5782585463da2bd2f41f7e92588e5085754 /src/nix-store
parent89effe9d4abde2ea8970736f79e0a6a499777692 (diff)
Factor out a `LogStore` interface
Continue progress on #5729. Just as I hoped, this uncovered an issue: the daemon protocol is missing a way to query build logs. This doesn't effect `unix://`, but does effect `ssh://`. A FIXME is left for this, so we come back to it later.
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/nix-store.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 33493500c..b3f28bcc2 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -4,6 +4,7 @@
#include "globals.hh"
#include "build-result.hh"
#include "gc-store.hh"
+#include "log-store.hh"
#include "local-store.hh"
#include "monitor-fd.hh"
#include "serve-protocol.hh"
@@ -474,13 +475,15 @@ static void opReadLog(Strings opFlags, Strings opArgs)
{
if (!opFlags.empty()) throw UsageError("unknown flag");
+ auto & logStore = LogStore::require(*store);
+
RunPager pager;
for (auto & i : opArgs) {
- auto path = store->followLinksToStorePath(i);
- auto log = store->getBuildLog(path);
+ auto path = logStore.followLinksToStorePath(i);
+ auto log = logStore.getBuildLog(path);
if (!log)
- throw Error("build log of derivation '%s' is not available", store->printStorePath(path));
+ throw Error("build log of derivation '%s' is not available", logStore.printStorePath(path));
std::cout << *log;
}
}