Skip to content

Commit e3397e0

Browse files
authored
Turn off trace messages (when checkMaterialization is disabled) to not bother user (#1555)
1 parent a32961b commit e3397e0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/materialize.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ let
3636
then builtins.trace ("Warning: ignoring materialized for " + name + " " + reason) x
3737
else x;
3838

39+
traceWhenChecking = message: x:
40+
if checkMaterialization
41+
then builtins.trace message x
42+
else x;
43+
3944
unchecked =
4045
let
4146
sha256message = "${name}: To make ${this} a fixed-output derivation but not materialized, set `${sha256Arg}` to the output of the 'calculateMaterializedSha' script in 'passthru'.";
@@ -50,10 +55,10 @@ let
5055
else if sha256 != null
5156
then
5257
# Let the user know how to materialize if they want to.
53-
builtins.trace materializeMessage calculateUseHash
58+
traceWhenChecking materializeMessage calculateUseHash
5459
else # materialized == null && sha256 == null
5560
# Let the user know how to calculate a sha256 or materialize if they want to.
56-
builtins.trace sha256message (builtins.trace materializeMessage calculateNoHash);
61+
traceWhenChecking sha256message (traceWhenChecking materializeMessage calculateNoHash);
5762

5863
# Build fully and check the hash and materialized versions
5964
checked =

0 commit comments

Comments
 (0)