git.iko.soy/typeable/nixpkgs
on master help sign in
make-derivation: use `lib.assertMsg`

As suggested by @Profpatsch

commitc7e026bec483582bf2b8ac624519555f9476751c authorPatrick Hilhorst <git@hilhorst.be> dateMon 29 Oct 2018, 18:25 (8 years ago) parent5be927d
1 file changed+4−2
pkgs/stdenv/generic/make-derivation.nix+4−2
pkgs/stdenv/generic/make-derivation.nix+4−2
@@ -83,8 +83,10 @@ rec {
8383 , ... } @ attrs:
8484
8585 # Check that the name is consistent with pname and version:
86− assert lib.lists.all (name: builtins.hasAttr name attrs) ["name" "pname" "version"]
87− -> lib.strings.hasSuffix "${attrs.pname}-${attrs.version}" attrs.name;
86+ assert lib.assertMsg
87+ (lib.lists.all (name: builtins.hasAttr name attrs) ["name" "pname" "version"]
88+ -> lib.strings.hasSuffix "${attrs.pname}-${attrs.version}" attrs.name)
89+ "mkDerivation: `name` must be consistent with `pname-version`";
8890
8991 let
9092 # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when