on iko/ghcjs-patch-master help sign in
Turn off `trace` messages (when `checkMaterialization` is disabled) to not bother user (#1555)
e3397e0Yvan Sraka
lib/materialize.nix+7−2
@@ -36,6 +36,11 @@ let
36 then builtins.trace ("Warning: ignoring materialized for " + name + " " + reason) x
36 then builtins.trace ("Warning: ignoring materialized for " + name + " " + reason) x
37 else x;
37 else x;
38
38
39+ traceWhenChecking = message: x:
40+ if checkMaterialization
41+ then builtins.trace message x
42+ else x;
43+
39 unchecked =
44 unchecked =
40 let
45 let
41 sha256message = "${name}: To make ${this} a fixed-output derivation but not materialized, set `${sha256Arg}` to the output of the 'calculateMaterializedSha' script in 'passthru'.";
46 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
50 else if sha256 != null
55 else if sha256 != null
51 then
56 then
52 # Let the user know how to materialize if they want to.
57 # Let the user know how to materialize if they want to.
53− builtins.trace materializeMessage calculateUseHash
58+ traceWhenChecking materializeMessage calculateUseHash
54 else # materialized == null && sha256 == null
59 else # materialized == null && sha256 == null
55 # Let the user know how to calculate a sha256 or materialize if they want to.
60 # 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);
57
62
58 # Build fully and check the hash and materialized versions
63 # Build fully and check the hash and materialized versions
59 checked =
64 checked =