From bd9246b00904af79c00d9d64e780fb7dd589c624 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 2 May 2017 01:43:22 -0400 Subject: [PATCH 1/2] treewide: Always use integers for meta.priority Meta attributes types are now enforce as of commit 90b9719f4fc95e54400a66bffcc8044c568cfa4b, so ensure meta.priority is always set to an integer. This fixes evaluation of `linuxPackages_latest.virtualbox` (the impetus for this commit) and other packages that use lowPrio or hiPrio. --- lib/meta.nix | 4 ++-- pkgs/applications/science/biology/ncbi-tools/default.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/meta.nix b/lib/meta.nix index 44e3cc011f18..ae652e579c39 100644 --- a/lib/meta.nix +++ b/lib/meta.nix @@ -45,7 +45,7 @@ rec { /* Decrease the nix-env priority of the package, i.e., other versions/variants of the package will be preferred. */ - lowPrio = drv: addMetaAttrs { priority = "10"; } drv; + lowPrio = drv: addMetaAttrs { priority = 10; } drv; /* Apply lowPrio to an attrset with derivations @@ -56,7 +56,7 @@ rec { /* Increase the nix-env priority of the package, i.e., this version/variant of the package will be preferred. */ - hiPrio = drv: addMetaAttrs { priority = "-10"; } drv; + hiPrio = drv: addMetaAttrs { priority = -10; } drv; /* Apply hiPrio to an attrset with derivations diff --git a/pkgs/applications/science/biology/ncbi-tools/default.nix b/pkgs/applications/science/biology/ncbi-tools/default.nix index e9d99aeb254c..821a80230e50 100644 --- a/pkgs/applications/science/biology/ncbi-tools/default.nix +++ b/pkgs/applications/science/biology/ncbi-tools/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { longDescription = ''The NCBI Bioinformatics toolsbox, including command-line utilties, libraries and include files. No X11 support''; homepage = http://www.ncbi.nlm.nih.gov/IEB/ToolBox/; license = "GPL"; - priority = "5"; # zlib.so gives a conflict with zlib + priority = 5; # zlib.so gives a conflict with zlib broken = true; }; } From d3acf9891cd22cab0d3821494d002890b617a04e Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 2 May 2017 01:45:30 -0400 Subject: [PATCH 2/2] 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 [];