From 7f3a4f428746620ca555797f1a7269bb2226e5dc Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Sun, 20 Mar 2016 13:15:37 +0000 Subject: [PATCH] Swap conditions of stdenvOverrides to prevent infinite loops while evaluating stdenvCross. While evaluating the derivation of xbursttools: the condition `pkgs.stdenv ? overrides` causes the evaluation of `stdenvCross`. This evaluation comes too early during the execution, as it prevents the resolution of names such as `pkgs.lib`, and `stdenvAdapaters.makeStdenvCross`, which we want to take from `pkgs` instead of `self` in following patches. By swapping the conditions, we effectively make the resolution of `pkgs.lib` and `stdenvAdapaters.makeStdenvCross` possible through the pkgs attribute. --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fb39447c9995..f16a7b6691c6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -100,7 +100,7 @@ let # otherwise the basic overrided packages will not be built with the # crossStdenv adapter. stdenvOverrides = pkgs: - lib.optionalAttrs (pkgs.stdenv ? overrides && crossSystem == null) + lib.optionalAttrs (crossSystem == null && pkgs.stdenv ? overrides) (pkgs.stdenv.overrides pkgs); # The un-overriden packages, passed to `overrider'.