git.iko.soy/typeable/nixpkgs
on master help sign in
top-level: Only splice as needed for performance
commitbfb147b6a8c4a3ddc581aab0b8a29b418db3b7a6 authorJohn Ericson <Ericson2314@Yahoo.com> dateSun 15 Jan 2017, 18:03 (10 years ago) parent4c17cd5
3 files changed+20−12
pkgs/stdenv/booter.nix+6−7 pkgs/top-level/splice.nix+9−2 pkgs/top-level/stage.nix+5−3
pkgs/stdenv/booter.nix+6−7
@@ -63,12 +63,11 @@ stageFuns: let
6363 __bootPackages = finalSoFar;
6464 };
6565 };
66− self =
67− if args.__raw or false
68− then args'
69− else allPackages ((builtins.removeAttrs args' ["selfBuild"]) // {
70− buildPackages = if args.selfBuild or true then self else finalSoFar;
71− });
72− in self;
66+ in
67+ if args.__raw or false
68+ then args'
69+ else allPackages ((builtins.removeAttrs args' ["selfBuild"]) // {
70+ buildPackages = if args.selfBuild or true then null else finalSoFar;
71+ });
7372
7473in lib.lists.fold folder {} withAllowCustomOverrides
pkgs/top-level/splice.nix+9−2
@@ -17,7 +17,11 @@
1717# `mkDerivation` knows how to pull out the right ones for `buildDepends` and
1818# friends, but a few packages use them directly, so it seemed efficient (to
1919# @Ericson2314) to reuse those names, at least initially, to minimize breakage.
20−lib: pkgs:
20+#
21+# For performance reasons, rather than uniformally splice in all cases, we only
22+# do so when `pkgs` and `buildPackages` are distinct. The `actuallySplice`
23+# parameter there the boolean value of that equality check.
24+lib: pkgs: actuallySplice:
2125
2226let
2327 defaultBuildScope = pkgs.buildPackages // pkgs.buildPackages.xorg;
@@ -58,7 +62,10 @@ let
5862 };
5963 in lib.listToAttrs (map merge (lib.attrNames mash));
6064
61− splicedPackages = splicer defaultBuildScope defaultRunScope;
65+ splicedPackages =
66+ if actuallySplice
67+ then splicer defaultBuildScope defaultRunScope
68+ else pkgs // pkgs.xorg;
6269
6370in
6471
pkgs/top-level/stage.nix+5−3
@@ -45,7 +45,8 @@
4545 ## Other parameters
4646 ##
4747
48−, # The package set used at build-time
48+, # The package set used at build-time. If null, `buildPackages` will
49+ # be defined internally as the produced package set as itself.
4950 buildPackages
5051
5152, # The standard environment to use for building packages.
@@ -84,7 +85,8 @@ let
8485 };
8586
8687 stdenvBootstappingAndPlatforms = self: super: {
87− buildPackages = buildPackages // { recurseForDerivations = false; };
88+ buildPackages = (if buildPackages == null then self else buildPackages)
89+ // { recurseForDerivations = false; };
8890 inherit stdenv
8991 buildPlatform hostPlatform targetPlatform;
9092 };
@@ -103,7 +105,7 @@ let
103105 inherit (buildPlatform) system platform;
104106 };
105107
106− splice = self: super: import ./splice.nix lib self;
108+ splice = self: super: import ./splice.nix lib self (buildPackages != null);
107109
108110 allPackages = self: super:
109111 let res = import ./all-packages.nix