about summary refs log tree commit diff
path: root/third_party/nix/src/nix-store
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-08-21T01·07+0100
committertazjin <mail@tazj.in>2020-08-21T01·35+0000
commit06681c35a9191656b8f3a9a343e21457a71a947d (patch)
tree68f05e9e535f7951c196c930c317d0132287247e /third_party/nix/src/nix-store
parent262af89f81eda6ce26845563141481d447e04a06 (diff)
refactor(tvix): Replace several DiscardLogsSink() with std::cerr r/1698
Introduces the actual log sink in several places where we actually
want the build logs to thread through correctly.

This should cover *most* build paths.

Change-Id: I735dff8a79f7e35a5874eb89b4abb980f9703dc2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1827
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'third_party/nix/src/nix-store')
-rw-r--r--third_party/nix/src/nix-store/nix-store.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/third_party/nix/src/nix-store/nix-store.cc b/third_party/nix/src/nix-store/nix-store.cc
index 101ab01ef9e7..535903d823ed 100644
--- a/third_party/nix/src/nix-store/nix-store.cc
+++ b/third_party/nix/src/nix-store/nix-store.cc
@@ -69,8 +69,7 @@ static PathSet realisePath(Path path, bool build = true) {
 
   if (isDerivation(p.first)) {
     if (build) {
-      auto discard_logs = DiscardLogsSink();
-      util::OkOrThrow(store->buildPaths(discard_logs, {path}));
+      util::OkOrThrow(store->buildPaths(std::cerr, {path}));
     }
     Derivation drv = store->derivationFromPath(p.first);
     rootNr++;
@@ -186,9 +185,8 @@ static void opRealise(Strings opFlags, Strings opArgs) {
   }
 
   /* Build all paths at the same time to exploit parallelism. */
-  auto discard_logs = DiscardLogsSink();
   util::OkOrThrow(store->buildPaths(
-      discard_logs, PathSet(paths.begin(), paths.end()), buildMode));
+      std::cerr, PathSet(paths.begin(), paths.end()), buildMode));
 
   if (!ignoreUnknown) {
     for (auto& i : paths) {
@@ -1006,8 +1004,7 @@ static void opServe(Strings opFlags, Strings opArgs) {
              does one path at a time. */
           if (!willSubstitute.empty()) {
             try {
-              auto discard_logs = DiscardLogsSink();
-              util::OkOrThrow(store->buildPaths(discard_logs, willSubstitute));
+              util::OkOrThrow(store->buildPaths(std::cerr, willSubstitute));
             } catch (Error& e) {
               LOG(WARNING) << e.msg();
             }
@@ -1069,8 +1066,7 @@ static void opServe(Strings opFlags, Strings opArgs) {
 
         try {
           MonitorFdHup monitor(in.fd);
-          auto discard_logs = DiscardLogsSink();
-          util::OkOrThrow(store->buildPaths(discard_logs, paths));
+          util::OkOrThrow(store->buildPaths(std::cerr, paths));
           out << 0;
         } catch (Error& e) {
           assert(e.status);