aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2023-03-28 08:22:26 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2023-03-28 21:02:08 +0200
commit74d94b2a13a9c60e1e1fc840dfd6df3683c3f8af (patch)
treee64c60b5278c2601e2f2cd070e8f0a964cdf4a8b /src/libstore
parent56dc6ed8410510033b835d48b3bd22766e8349a0 (diff)
Don't recommend 'nix log' unless experimental feature is enabled
This fixes the issue that `nix-build`, without experimental feature 'nix-command' enabled, recommends the experimental CLI `nix log` to view build logs. Now it'll recommend the stable `nix-store -l` CLI instead. Fixes https://github.com/NixOS/nix/issues/8118
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build/derivation-goal.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index 596034c0f..26faf8c8e 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -911,7 +911,11 @@ void DerivationGoal::buildDone()
msg += line;
msg += "\n";
}
- msg += fmt("For full logs, run '" ANSI_BOLD "nix log %s" ANSI_NORMAL "'.",
+ auto nixLogCommand = experimentalFeatureSettings.isEnabled(Xp::NixCommand)
+ ? "nix log"
+ : "nix-store -l";
+ msg += fmt("For full logs, run '" ANSI_BOLD "%s %s" ANSI_NORMAL "'.",
+ nixLogCommand,
worker.store.printStorePath(drvPath));
}