From 92edcb7ebbf5b4b324288ec62bebbc58a3f96ef6 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 24 Dec 2016 10:55:11 -0800 Subject: top-level: Lay the groundwork for `{build,host,target}Platform` The long term goal is a big replace: { inherit system platform; } => buildPlatform crossSystem => hostPlatform stdenv.cross => targetPlatform And additionally making sure each is defined even when not cross compiling. This commit refactors the bootstrapping code along that vision, but leaves the old identifiers with their null semantics in place so packages can be modernized incrementally. --- pkgs/top-level/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkgs/top-level/default.nix') diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix index a146dad63bc8..b7a4273acff0 100644 --- a/pkgs/top-level/default.nix +++ b/pkgs/top-level/default.nix @@ -83,7 +83,8 @@ in let boot = import ../stdenv/booter.nix { inherit lib allPackages; }; stages = stdenvStages { - inherit lib system platform crossSystem config overlays; + localSystem = { inherit system platform; }; + inherit lib crossSystem config overlays; }; pkgs = boot stages; -- cgit 1.4.1 From 4c17cd555f6443207144da9af6e1c2b1304afd8b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 15 Jan 2017 17:45:04 -0500 Subject: top-level: Document the `{local,cross}System, contrasting with `*Platform` This is an implementation detail of how the bootstrapping chain is chosen, and thus need not be in the manual. --- pkgs/top-level/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'pkgs/top-level/default.nix') diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix index b7a4273acff0..3c67d316f7c8 100644 --- a/pkgs/top-level/default.nix +++ b/pkgs/top-level/default.nix @@ -83,6 +83,22 @@ in let boot = import ../stdenv/booter.nix { inherit lib allPackages; }; stages = stdenvStages { + # One would think that `localSystem` and `crossSystem` overlap horribly with + # the three `*Platforms` (`buildPlatform`, `hostPlatform,` and + # `targetPlatform`; see `stage.nix` or the manual). Actually, those + # identifiers I, @Ericson2314, purposefully not used here to draw a subtle + # but important distinction: + # + # While the granularity of having 3 platforms is necessary to properly + # *build* packages, it is overkill for specifying the user's *intent* when + # making a build plan or package set. A simple "build vs deploy" dichotomy + # is adequate: the "sliding window" principle described in the manual shows + # how to interpolate between the these two "end points" to get the 3 + # platform triple for each bootstrapping stage. + # + # Also, less philosophically but quite practically, `crossSystem` should be + # null when one doesn't want to cross-compile, while the `*Platform`s are + # always non-null. `localSystem` is always non-null. localSystem = { inherit system platform; }; inherit lib crossSystem config overlays; }; -- cgit 1.4.1