diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2019-02-04 09:15:03 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2019-02-04 09:15:03 -0500 |
commit | c6f8f8d98de092f6e6540822849dee994f41dde5 (patch) | |
tree | f2290287f22b0ba1f9c149bf5063001e909d8b30 /pkgs/stdenv | |
parent | 59949aa55ce23ecdb8661b57df57b8fa2d84d0b7 (diff) |
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')
-rw-r--r-- | pkgs/stdenv/generic/make-derivation.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 8f0f12ea1a20b..fdb3a2ce35a26 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 |