From 50148f06304ba1dce9130f9476a73fc2d955e10e Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 3 Jan 2018 15:22:35 +0000 Subject: [PATCH] stdenv: hide `name` under `check-meta` assert This is a temporary workaround to make `nix-env -qa` and `nix search` ignore broken packages as they they did before this patchset. This patch should be reverted after `nix` gets a proper fix for this. See NixOS/nix#1771. --- pkgs/stdenv/generic/make-derivation.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index ab5edfcd17c..aef39fedb79 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -134,9 +134,12 @@ rec { (lib.concatLists propagatedDependencies)); in { - name = name + lib.optionalString + # 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 (stdenv.hostPlatform != stdenv.buildPlatform) ("-" + stdenv.hostPlatform.config); + builder = attrs.realBuilder or stdenv.shell; args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; inherit stdenv;