summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-09-18 15:35:11 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-09-18 16:25:19 -0400
commit2111e7b742aa0121a7b3b14738811ad030a6c321 (patch)
tree337b9cc0d58f8b3d8f8d0255d888396d466be3bc /pkgs/stdenv
parent67694371869eaa43933f47f5cbcb87024945a72d (diff)
downloadnixlib-2111e7b742aa0121a7b3b14738811ad030a6c321.tar
nixlib-2111e7b742aa0121a7b3b14738811ad030a6c321.tar.gz
nixlib-2111e7b742aa0121a7b3b14738811ad030a6c321.tar.bz2
nixlib-2111e7b742aa0121a7b3b14738811ad030a6c321.tar.lz
nixlib-2111e7b742aa0121a7b3b14738811ad030a6c321.tar.xz
nixlib-2111e7b742aa0121a7b3b14738811ad030a6c321.tar.zst
nixlib-2111e7b742aa0121a7b3b14738811ad030a6c321.zip
mkDerivation: Make `separateDebugInfo` assertion lazier to match other assertions
This is needed to access attributes of derivations on platforms where
they cannot be built.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix6
1 files changed, 2 insertions, 4 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index e1ce3200e8c9..c663c3743ed6 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -83,9 +83,7 @@ rec {
       doCheck' = doCheck && stdenv.hostPlatform == stdenv.buildPlatform;
       doInstallCheck' = doInstallCheck && stdenv.hostPlatform == stdenv.buildPlatform;
 
-      outputs' =
-        outputs ++
-        (if separateDebugInfo then assert stdenv.hostPlatform.isLinux; [ "debug" ] else []);
+      outputs' = outputs ++ lib.optional separateDebugInfo "debug";
 
       fixedOutputDrv = attrs ? outputHash;
       noNonNativeDeps = builtins.length (depsBuildTarget ++ depsBuildTargetPropagated
@@ -176,7 +174,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 validity.handled; name + lib.optionalString
+          name = assert validity.handled && (separateDebugInfo -> stdenv.hostPlatform.isLinux); name + 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