From 0f33b9f7f11e414ff6213359ec2859199a68d550 Mon Sep 17 00:00:00 2001 From: David Grayson Date: Wed, 21 Dec 2016 18:42:53 -0800 Subject: [PATCH] top-level: Do stdenvOverrides in stage.nix even if crossSystem exists. Instead, the cross stdenv will patch up the override field -- the complexity is now confined to the one place it matters. --- pkgs/stdenv/cross/default.nix | 1 + pkgs/top-level/stage.nix | 13 ++++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pkgs/stdenv/cross/default.nix b/pkgs/stdenv/cross/default.nix index 728424c0a7af..359d45b78b96 100644 --- a/pkgs/stdenv/cross/default.nix +++ b/pkgs/stdenv/cross/default.nix @@ -24,6 +24,7 @@ in bootStages ++ [ stdenv = vanillaPackages.stdenv // { # Needed elsewhere as a hacky way to pass the target cross = crossSystem; + overrides = _: _: {}; }; }) diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 0b1326414b64..f6f11b439800 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -58,16 +58,11 @@ let aliases = self: super: import ./aliases.nix super; - # stdenvOverrides is used to avoid circular dependencies for building - # the standard build environment. This mechanism uses the override - # mechanism to implement some staged compilation of the stdenv. - # - # We don't want stdenv overrides in the case of cross-building, or - # otherwise the basic overridden packages will not be built with the - # crossStdenv adapter. + # stdenvOverrides is used to avoid having multiple of versions + # of certain dependencies that were used in bootstrapping the + # standard environment. stdenvOverrides = self: super: - lib.optionalAttrs (crossSystem == null && super.stdenv ? overrides) - (super.stdenv.overrides self super); + (super.stdenv.overrides or (_: _: {})) self super; # Allow packages to be overridden globally via the `packageOverrides' # configuration option, which must be a function that takes `pkgs'