git.iko.soy/typeable/nixpkgs
on master help sign in
mkDerivation: Make `separateDebugInfo` assertion lazier to match other assertions

This is needed to access attributes of derivations on platforms where they cannot be built.

commit2111e7b742aa0121a7b3b14738811ad030a6c321 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateTue 18 Sep 2018, 15:35 (8 years ago) parent6769437
2 files changed+3−6
pkgs/development/libraries/glibc/default.nix+1−2 pkgs/stdenv/generic/make-derivation.nix+2−4
pkgs/development/libraries/glibc/default.nix+1−2
@@ -94,8 +94,7 @@ callPackage ./common.nix { inherit stdenv; } {
9494 mv $bin/bin/getconf_ $bin/bin/getconf
9595 '';
9696
97− # Hack to get around eval issue.
98− separateDebugInfo = !stdenv.isDarwin;
97+ separateDebugInfo = true;
9998
10099 meta.description = "The GNU C Library";
101100 }
pkgs/stdenv/generic/make-derivation.nix+2−4
@@ -83,9 +83,7 @@ rec {
8383 doCheck' = doCheck && stdenv.hostPlatform == stdenv.buildPlatform;
8484 doInstallCheck' = doInstallCheck && stdenv.hostPlatform == stdenv.buildPlatform;
8585
86− outputs' =
87− outputs ++
88− (if separateDebugInfo then assert stdenv.hostPlatform.isLinux; [ "debug" ] else []);
86+ outputs' = outputs ++ lib.optional separateDebugInfo "debug";
8987
9088 fixedOutputDrv = attrs ? outputHash;
9189 noNonNativeDeps = builtins.length (depsBuildTarget ++ depsBuildTargetPropagated
@@ -176,7 +174,7 @@ rec {
176174 // {
177175 # A hack to make `nix-env -qa` and `nix search` ignore broken packages.
178176 # TODO(@oxij): remove this assert when something like NixOS/nix#1771 gets merged into nix.
179− name = assert validity.handled; name + lib.optionalString
177+ name = assert validity.handled && (separateDebugInfo -> stdenv.hostPlatform.isLinux); name + lib.optionalString
180178 # Fixed-output derivations like source tarballs shouldn't get a host
181179 # suffix. But we have some weird ones with run-time deps that are
182180 # just used for their side-affects. Those might as well since the