Skip to content

Commit

Permalink
Don't recommend 'nix log' unless experimental feature is enabled
Browse files Browse the repository at this point in the history
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 #8118
  • Loading branch information
bjornfor committed Mar 28, 2023
1 parent 56dc6ed commit a443639
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/libstore/build/derivation-goal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,15 @@ void DerivationGoal::buildDone()
msg += line;
msg += "\n";
}
msg += fmt("For full logs, run '" ANSI_BOLD "nix log %s" ANSI_NORMAL "'.",
worker.store.printStorePath(drvPath));
msg += "For full logs, run '" ANSI_BOLD;
if (experimentalFeatureSettings.isEnabled(Xp::NixCommand)) {
msg += "nix log";
} else {
msg += "nix-store -l";
}
msg += " ";
msg += worker.store.printStorePath(drvPath);
msg += ANSI_NORMAL "'.";
}

if (diskFull)
Expand Down

0 comments on commit a443639

Please sign in to comment.