summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorPatrick Hilhorst <git@hilhorst.be>2018-10-29 18:25:59 +0100
committerPatrick Hilhorst <git@hilhorst.be>2018-10-29 18:25:59 +0100
commitc7e026bec483582bf2b8ac624519555f9476751c (patch)
treef21fc0f00ee886dd4a07da9c120b3a96bc6f553f /pkgs/stdenv/generic
parent5be927db142448207c6a1d0c6e58ac5eb2af1fc5 (diff)
downloadnixpkgs-c7e026bec483582bf2b8ac624519555f9476751c.tar
nixpkgs-c7e026bec483582bf2b8ac624519555f9476751c.tar.gz
nixpkgs-c7e026bec483582bf2b8ac624519555f9476751c.tar.bz2
nixpkgs-c7e026bec483582bf2b8ac624519555f9476751c.tar.lz
nixpkgs-c7e026bec483582bf2b8ac624519555f9476751c.tar.xz
nixpkgs-c7e026bec483582bf2b8ac624519555f9476751c.tar.zst
nixpkgs-c7e026bec483582bf2b8ac624519555f9476751c.zip
make-derivation: use `lib.assertMsg`
As suggested by @Profpatsch
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 9f6fee93710..2ff7db947fe 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -83,8 +83,10 @@ rec {
     , ... } @ attrs:
 
     # Check that the name is consistent with pname and version:
-    assert lib.lists.all (name: builtins.hasAttr name attrs) ["name" "pname" "version"]
-      -> lib.strings.hasSuffix "${attrs.pname}-${attrs.version}" attrs.name;
+    assert lib.assertMsg
+      (lib.lists.all (name: builtins.hasAttr name attrs) ["name" "pname" "version"]
+        -> lib.strings.hasSuffix "${attrs.pname}-${attrs.version}" attrs.name)
+      "mkDerivation: `name` must be consistent with `pname-version`";
 
     let
       # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when