From d3acf9891cd22cab0d3821494d002890b617a04e Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 2 May 2017 01:45:30 -0400 Subject: [PATCH] stdenv: More useful error message on bad meta attrs This helps in debugging meta attribute type errors, which are now enforced as of commit 90b9719f4fc95e54400a66bffcc8044c568cfa4b. --- pkgs/stdenv/generic/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 0f9223f6da59..6fb9375596e7 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -236,7 +236,7 @@ let checkMetaAttr = k: v: if metaTypes?${k} then - if metaTypes.${k}.check v then null else "key '${k}' has a value of an invalid type; expected ${metaTypes.${k}.description}" + if metaTypes.${k}.check v then null else "key '${k}' has a value ${v} of an invalid type ${builtins.typeOf v}; expected ${metaTypes.${k}.description}" else "key '${k}' is unrecognized; expected one of: \n\t [${lib.concatMapStringsSep ", " (x: "'${x}'") (lib.attrNames metaTypes)}]"; checkMeta = meta: if shouldCheckMeta then lib.remove null (lib.mapAttrsToList checkMetaAttr meta) else [];