Skip to content

Turn off trace messages (when checkMaterialization is disabled) to not bother user #1555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/materialize.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ let
then builtins.trace ("Warning: ignoring materialized for " + name + " " + reason) x
else x;

traceWhenChecking = message: x:
if checkMaterialization
then builtins.trace message x
else x;

unchecked =
let
sha256message = "${name}: To make ${this} a fixed-output derivation but not materialized, set `${sha256Arg}` to the output of the 'calculateMaterializedSha' script in 'passthru'.";
Expand All @@ -50,10 +55,10 @@ let
else if sha256 != null
then
# Let the user know how to materialize if they want to.
builtins.trace materializeMessage calculateUseHash
traceWhenChecking materializeMessage calculateUseHash
else # materialized == null && sha256 == null
# Let the user know how to calculate a sha256 or materialize if they want to.
builtins.trace sha256message (builtins.trace materializeMessage calculateNoHash);
traceWhenChecking sha256message (traceWhenChecking materializeMessage calculateNoHash);

# Build fully and check the hash and materialized versions
checked =
Expand Down