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
This commit is contained in:
Bjørn Forsman 2023-03-28 08:22:26 +02:00
parent 56dc6ed841
commit 74d94b2a13

View file

@ -911,7 +911,11 @@ void DerivationGoal::buildDone()
msg += line; msg += line;
msg += "\n"; 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)); worker.store.printStorePath(drvPath));
} }