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.
This commit is contained in:
David Grayson 2016-12-21 18:42:53 -08:00 committed by John Ericson
parent 3e197f7d81
commit 0f33b9f7f1
2 changed files with 5 additions and 9 deletions

View file

@ -24,6 +24,7 @@ in bootStages ++ [
stdenv = vanillaPackages.stdenv // {
# Needed elsewhere as a hacky way to pass the target
cross = crossSystem;
overrides = _: _: {};
};
})

View file

@ -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'