on iko/ghcjs-patch-master help sign in
Don't reference scripts directly in materialization messages (#945)
1dce3ffMichael Peyton Jones
lib/call-cabal-project-to-nix.nix+1
@@ -369,6 +369,7 @@ let
369 inherit materialized;
369 inherit materialized;
370 sha256 = plan-sha256;
370 sha256 = plan-sha256;
371 sha256Arg = "plan-sha256";
371 sha256Arg = "plan-sha256";
372+ this = "project.plan-nix" + (if name != null then " for ${name}" else "");
372 # Before pinning stuff down we need an index state to use
373 # Before pinning stuff down we need an index state to use
373 reasonNotSafe =
374 reasonNotSafe =
374 if !index-state-pinned
375 if !index-state-pinned
lib/call-stack-to-nix.nix+1
@@ -34,6 +34,7 @@ let
34 sha256 = stack-sha256;
34 sha256 = stack-sha256;
35 sha256Arg = "stack-sha256";
35 sha256Arg = "stack-sha256";
36 reasonNotSafe = null;
36 reasonNotSafe = null;
37+ this = "project.stack-nix" + (if name != null then " for ${name}" else "");
37 } // pkgs.lib.optionalAttrs (checkMaterialization != null) {
38 } // pkgs.lib.optionalAttrs (checkMaterialization != null) {
38 inherit checkMaterialization;
39 inherit checkMaterialization;
39 }) (runCommand (if name == null then "stack-to-nix-pkgs" else name + "-stack-to-nix-pkgs") {
40 }) (runCommand (if name == null then "stack-to-nix-pkgs" else name + "-stack-to-nix-pkgs") {
lib/materialize.nix+5−2
@@ -7,6 +7,9 @@
7 # the output. If this is set but does not exist
7 # the output. If this is set but does not exist
8 # the derivation will fail but with a message
8 # the derivation will fail but with a message
9 # advising how to populate it.
9 # advising how to populate it.
10+, this ? "this"
11+ # A name to use when referring to the thing currently being
12+ # materialized. Clients can pass in an attribute name or similar.
10, reasonNotSafe ? null
13, reasonNotSafe ? null
11 # Some times there a reasont the derivation will
14 # Some times there a reasont the derivation will
12 # not produce output that can be safely materialized.
15 # not produce output that can be safely materialized.
@@ -35,8 +38,8 @@ let
35
38
36 unchecked =
39 unchecked =
37 let
40 let
38− sha256message = "To make this a fixed-output derivation but not materialized, set `${sha256Arg}` to the output of ${calculateMaterializedSha}";
41+ sha256message = "To make ${this} a fixed-output derivation but not materialized, set `${sha256Arg}` to the output of the 'calculateMaterializedSha' script in 'passthru'.";
39− materializeMessage = "To materialize the output entirely, pass a writable path as the `materialized` argument and pass that path to ${generateMaterialized}";
42+ materializeMessage = "To materialize ${this} entirely, pass a writable path as the `materialized` argument and run the 'updateMaterialized' script in 'passthru'.";
40 in if reasonNotSafe != null
43 in if reasonNotSafe != null
41 then
44 then
42 # Warn the user if they tried to pin stuff down when it is not safe
45 # Warn the user if they tried to pin stuff down when it is not safe