about summary refs log tree commit diff
path: root/third_party/nix/src/nix-env
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-env
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-env')
-rw-r--r--third_party/nix/src/nix-env/nix-env.cc4
-rw-r--r--third_party/nix/src/nix-env/user-env.cc7
2 files changed, 5 insertions, 6 deletions
diff --git a/third_party/nix/src/nix-env/nix-env.cc b/third_party/nix/src/nix-env/nix-env.cc
index e42fc29c22..9c0931e7f4 100644
--- a/third_party/nix/src/nix-env/nix-env.cc
+++ b/third_party/nix/src/nix-env/nix-env.cc
@@ -722,10 +722,8 @@ static void opSet(Globals& globals, Strings opFlags, Strings opArgs) {
     if (globals.dryRun) {
       return;
     }
-    auto discard_logs = DiscardLogsSink();
     nix::util::OkOrThrow(globals.state->store->buildPaths(
-        discard_logs, paths,
-        globals.state->repair != 0u ? bmRepair : bmNormal));
+        std::cerr, paths, globals.state->repair != 0u ? bmRepair : bmNormal));
   } else {
     printMissing(globals.state->store, {drv.queryOutPath()});
     if (globals.dryRun) {
diff --git a/third_party/nix/src/nix-env/user-env.cc b/third_party/nix/src/nix-env/user-env.cc
index e3124a60e3..bce5c44f95 100644
--- a/third_party/nix/src/nix-env/user-env.cc
+++ b/third_party/nix/src/nix-env/user-env.cc
@@ -1,5 +1,7 @@
 #include "nix-env/user-env.hh"
 
+#include <iostream>
+
 #include <glog/logging.h>
 
 #include "libexpr/eval-inline.hh"
@@ -38,9 +40,8 @@ bool createUserEnv(EvalState& state, DrvInfos& elems, const Path& profile,
   }
 
   DLOG(INFO) << "building user environment dependencies";
-  auto discard_logs = DiscardLogsSink();
   util::OkOrThrow(state.store->buildPaths(
-      discard_logs, drvsToBuild, state.repair != 0u ? bmRepair : bmNormal));
+      std::cerr, drvsToBuild, state.repair != 0u ? bmRepair : bmNormal));
 
   /* Construct the whole top level derivation. */
   PathSet references;
@@ -140,7 +141,7 @@ bool createUserEnv(EvalState& state, DrvInfos& elems, const Path& profile,
   /* Realise the resulting store expression. */
   DLOG(INFO) << "building user environment";
   util::OkOrThrow(state.store->buildPaths(
-      discard_logs, {topLevelDrv}, state.repair != 0u ? bmRepair : bmNormal));
+      std::cerr, {topLevelDrv}, state.repair != 0u ? bmRepair : bmNormal));
 
   /* Switch the current user environment to the output path. */
   auto store2 = state.store.dynamic_pointer_cast<LocalFSStore>();