From eaee2a119916b2761d08cb8f68f1b4afbde15e51 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Tue, 2 Jan 2018 14:52:27 +0000 Subject: [PATCH] stdenv: implement `config.checkMetaRecursively` This option makes `meta.evaluate` into a close approximation of the result of evaluating `.outPath` by checking all the dependencies recursively at a cost of 2x slowdown. Note that actually evaluating `.outPath` costs some 5x-7x more because `.outPath` also computes all the hashes. --- pkgs/stdenv/generic/make-derivation.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 78e558daff1b..ab5edfcd17c0 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -72,6 +72,9 @@ rec { inherit erroneousHardeningFlags hardeningDisable hardeningEnable supportedHardeningFlags; }) else let + references = nativeBuildInputs ++ buildInputs + ++ propagatedNativeBuildInputs ++ propagatedBuildInputs; + dependencies = map (map lib.chooseDevOutputs) [ [ (map (drv: drv.__spliced.buildBuild or drv) depsBuildBuild) @@ -213,7 +216,10 @@ rec { position = pos.file + ":" + toString pos.line; # Expose the result of the checks for everyone to see. } // { - evaluates = validity.valid; + evaluates = validity.valid + && (if config.checkMetaRecursively or false + then lib.all (d: d.meta.evaluates or true) references + else true); }; in