summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-02-04 09:15:03 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2019-02-04 09:15:03 -0500
commitc6f8f8d98de092f6e6540822849dee994f41dde5 (patch)
treef2290287f22b0ba1f9c149bf5063001e909d8b30 /pkgs/stdenv/generic
parent59949aa55ce23ecdb8661b57df57b8fa2d84d0b7 (diff)
downloadnixpkgs-c6f8f8d98de092f6e6540822849dee994f41dde5.tar
nixpkgs-c6f8f8d98de092f6e6540822849dee994f41dde5.tar.gz
nixpkgs-c6f8f8d98de092f6e6540822849dee994f41dde5.tar.bz2
nixpkgs-c6f8f8d98de092f6e6540822849dee994f41dde5.tar.lz
nixpkgs-c6f8f8d98de092f6e6540822849dee994f41dde5.tar.xz
nixpkgs-c6f8f8d98de092f6e6540822849dee994f41dde5.tar.zst
nixpkgs-c6f8f8d98de092f6e6540822849dee994f41dde5.zip
make-derivation: only modify name when name is given
This preserves Nix’s native error handling of missing name:

  error: derivation name missing
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 8f0f12ea1a2..fdb3a2ce35a 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -177,9 +177,9 @@ rec {
            "checkInputs" "installCheckInputs"
            "__impureHostDeps" "__propagatedImpureHostDeps"
            "sandboxProfile" "propagatedSandboxProfile"])
-        // (lib.optionalAttrs (!(attrs ? name))) {
+        // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) {
           name = "${attrs.pname}-${attrs.version}";
-        } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix)) {
+        } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) {
           # 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