diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2018-11-28 12:26:21 -0600 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2018-11-28 12:26:21 -0600 |
commit | 13e45aeed302363be9eed17c75db80fcc3e0100e (patch) | |
tree | d6fcbe06ab01e939e41f5e54df89dd192ddb8753 /pkgs/stdenv/generic/make-derivation.nix | |
parent | 5987c5c694f3910e308beda967192cccf9a63610 (diff) | |
download | nixlib-13e45aeed302363be9eed17c75db80fcc3e0100e.tar nixlib-13e45aeed302363be9eed17c75db80fcc3e0100e.tar.gz nixlib-13e45aeed302363be9eed17c75db80fcc3e0100e.tar.bz2 nixlib-13e45aeed302363be9eed17c75db80fcc3e0100e.tar.lz nixlib-13e45aeed302363be9eed17c75db80fcc3e0100e.tar.xz nixlib-13e45aeed302363be9eed17c75db80fcc3e0100e.tar.zst nixlib-13e45aeed302363be9eed17c75db80fcc3e0100e.zip |
make-derivation: remove selfConsistent check
version is set in lots of places but might not need to be in a name. Alternative to #50364.
Diffstat (limited to 'pkgs/stdenv/generic/make-derivation.nix')
-rw-r--r-- | pkgs/stdenv/generic/make-derivation.nix | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 57e757080a2d..b4e391629511 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -81,13 +81,6 @@ rec { , ... } @ attrs: let - # Check that the name is consistent with pname and version: - selfConsistent = (with attrs; attrs ? "name" -> - (lib.assertMsg (attrs ? "version" -> lib.strings.hasInfix version name) - "version ${version} does not appear in name ${name}" && - lib.assertMsg (attrs ? "pname" -> lib.strings.hasInfix pname name) - "pname ${pname} does not appear in name ${name}")); - computedName = if name != "" then name else "${attrs.pname}-${attrs.version}"; # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when @@ -188,7 +181,7 @@ rec { // { # A hack to make `nix-env -qa` and `nix search` ignore broken packages. # TODO(@oxij): remove this assert when something like NixOS/nix#1771 gets merged into nix. - name = assert selfConsistent && validity.handled && (separateDebugInfo -> stdenv.hostPlatform.isLinux); computedName + lib.optionalString + name = assert validity.handled && (separateDebugInfo -> stdenv.hostPlatform.isLinux); computedName + lib.optionalString # Fixed-output derivations like source tarballs shouldn't get a host # suffix. But we have some weird ones with run-time deps that are # just used for their side-affects. Those might as well since the |