Skip to content

Commit

Permalink
Turn off trace messages (when checkMaterialization is disabled) t…
Browse files Browse the repository at this point in the history
…o not bother user (#1555)
  • Loading branch information
yvan-sraka committed Jul 26, 2022
1 parent a32961b commit e3397e0
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit e3397e0

Please sign in to comment.