mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
stdenv: consistently use self: super: …
for bootstrapping overlays
As of late, `final: prev: …` for overlays has become more prevalent in newer code. This is also exhibited in some code (presumably added recently) in stdenv. This change is not about any merits or demerits of any naming convention, but rather aims to make the nomenclature in stdenv bootstrapping consistent to lessen confusion. I've chosen to stick to `self: super: …` convention because: 1. It is more common in the code as it stands. 2. Using `final: prev: …` makes the code more confusing, als it causes `prev` to be in scope alongside `prevStage`. `prevStage` actually bears no relation to `prev` even though their naming suggests it, making it easy to confuse them (the former is the (final) package set of the previous stage while the latter is just the `prev`/`super` of the overlay “chaining” on a completely fresh package set, i.e. `prev` doesn't even relate to the previous stage's `overrides` argument). This change also corrects a naming error in stdenv/native which had no effect, as the variables were unused.
This commit is contained in:
parent
fde3861f21
commit
0198f43efb
@ -328,12 +328,12 @@ in
|
||||
assert isBuiltByBootstrapFilesCompiler prevStage.patchelf;
|
||||
stageFun prevStage {
|
||||
name = "bootstrap-stage-xgcc";
|
||||
overrides = final: prev: {
|
||||
overrides = self: super: {
|
||||
inherit (prevStage) ccWrapperStdenv coreutils gnugrep gettext bison texinfo zlib gnum4 perl patchelf;
|
||||
${localSystem.libc} = getLibc prevStage;
|
||||
gmp = prev.gmp.override { cxx = false; };
|
||||
gmp = super.gmp.override { cxx = false; };
|
||||
gcc-unwrapped =
|
||||
(prev.gcc-unwrapped.override (commonGccOverrides // {
|
||||
(super.gcc-unwrapped.override (commonGccOverrides // {
|
||||
# The most logical name for this package would be something like
|
||||
# "gcc-stage1". Unfortunately "stage" is already reserved for the
|
||||
# layers of stdenv, so using "stage" in the name of this package
|
||||
@ -376,7 +376,7 @@ in
|
||||
#
|
||||
configureFlags = (a.configureFlags or []) ++ [
|
||||
"--with-native-system-header-dir=/include"
|
||||
"--with-build-sysroot=${lib.getDev final.stdenv.cc.libc}"
|
||||
"--with-build-sysroot=${lib.getDev self.stdenv.cc.libc}"
|
||||
];
|
||||
|
||||
# This is a separate phase because gcc assembles its phase scripts
|
||||
|
@ -152,7 +152,7 @@ in
|
||||
inherit config overlays;
|
||||
stdenv = makeStdenv {
|
||||
inherit (prevStage) cc fetchurl;
|
||||
overrides = prev: final: { inherit (prevStage) fetchurl; };
|
||||
overrides = self: super: { inherit (prevStage) fetchurl; };
|
||||
} // {
|
||||
inherit (prevStage) fetchurl;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user