tree-wide: do not use pkgs.extend in nixpkgs

Each invocation of pkgs.extends adds 130MB of allocation to the hydra
evaluator. We are already struggling with the amount of memory nixpkgs
requires.

`pkgs.extend` is a useful escape-hatch, but should be not be used inside
of nixpkgs directly.
This commit is contained in:
zimbatm 2020-11-30 14:20:28 +01:00
parent c5d33689da
commit bbc9af1f0a
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7
6 changed files with 17 additions and 39 deletions

View file

@ -28,6 +28,7 @@
</para>
<para>
NOTE: DO NOT USE THIS in nixpkgs.
Further overlays can be added by calling the <literal>pkgs.extend</literal> or <literal>pkgs.appendOverlays</literal>, although it is often preferable to avoid these functions, because they recompute the Nixpkgs fixpoint, which is somewhat expensive to do.
</para>
</section>

View file

@ -96,5 +96,7 @@ mkDerivation rec {
license = stdenv.lib.licenses.gpl2Plus;
maintainers = with stdenv.lib.maintainers; [ worldofpeace ];
platforms = [ "x86_64-linux" ];
# Needs QT 5.14
broken = true;
};
}

View file

@ -53,5 +53,8 @@ in mkDerivation rec {
license = lib.licenses.gpl2Plus;
platforms = with lib.platforms; linux;
maintainers = with lib.maintainers; [ lsix ];
# Our 3.10 LTS cannot use a newer Qt (5.15) version because it requires qtwebkit
# and our qtwebkit fails to build with 5.15. 01bcfd3579219d60e5d07df309a000f96b2b658b
broken = true;
};
}

View file

@ -55,5 +55,8 @@ mkDerivationWith python3Packages.buildPythonApplication rec {
license = with licenses; gpl3Plus;
maintainers = with maintainers; [ AndersonTorres ];
platforms = with platforms; unix;
# Cannot use a newer Qt (5.15) version because it requires qtwebkit
# and our qtwebkit fails to build with 5.15. 01bcfd3579219d60e5d07df309a000f96b2b658b
broken = true;
};
}

View file

@ -9543,15 +9543,7 @@ in
graalvm8-ee
graalvm11-ee;
# Cannot use a newer Qt (5.15) version because it requires qtwebkit
# and our qtwebkit fails to build with 5.15. 01bcfd3579219d60e5d07df309a000f96b2b658b
openshot-qt = (pkgs.extend (final: prev: rec {
qt5 = if stdenv.isDarwin then prev.qt5 else prev.qt514;
libsForQt5 = if stdenv.isDarwin then prev.libsForQt5 else prev.libsForQt514;
pythonInterpreters = prev.pythonInterpreters.override {
pkgs = final;
};
})).libsForQt5.callPackage ../applications/video/openshot-qt { };
openshot-qt = libsForQt5.callPackage ../applications/video/openshot-qt { };
openspin = callPackage ../development/compilers/openspin { };
@ -10541,12 +10533,7 @@ in
python2Packages = python2.pkgs;
python3Packages = python3.pkgs;
pythonInterpreters = callPackage ./../development/interpreters/python {
# Overrides that apply to all Python interpreters and their packages
# Generally, this should be avoided.
pkgs = pkgs.extend (final: _: {
});
};
pythonInterpreters = callPackage ./../development/interpreters/python { };
inherit (pythonInterpreters) python27 python36 python37 python38 python39 python310 python3Minimal pypy27 pypy36;
# Python package sets.
@ -20227,17 +20214,7 @@ in
bambootracker = libsForQt5.callPackage ../applications/audio/bambootracker { };
cadence = let
# Use Qt 5.14 consistently
pkgs_ = pkgs.extend(_: prev: {
pythonInterpreters = prev.pythonInterpreters.override(oldAttrs: {
pkgs = oldAttrs.pkgs.extend(_: _: {
qt5 = pkgs.qt514;
libsForQt5 = pkgs.libsForQt514;
});
});
});
in pkgs_.libsForQt514.callPackage ../applications/audio/cadence { };
cadence = libsForQt5.callPackage ../applications/audio/cadence { };
cheesecutter = callPackage ../applications/audio/cheesecutter { };
@ -23355,19 +23332,8 @@ in
qemu-utils = callPackage ../applications/virtualization/qemu/utils.nix {};
# Our 3.10 LTS cannot use a newer Qt (5.15) version because it requires qtwebkit
# and our qtwebkit fails to build with 5.15. 01bcfd3579219d60e5d07df309a000f96b2b658b
qgis-unwrapped = let
pkgs_ = pkgs.extend(_: prev: {
pythonInterpreters = prev.pythonInterpreters.override(oldAttrs: {
pkgs = oldAttrs.pkgs.extend(_: _: {
qt5 = pkgs.qt514;
libsForQt5 = pkgs.libsForQt514;
});
});
});
in pkgs_.libsForQt514.callPackage ../applications/gis/qgis/unwrapped.nix {
withGrass = false;
qgis-unwrapped = libsForQt5.callPackage ../applications/gis/qgis/unwrapped.nix {
withGrass = false;
};
qgis = callPackage ../applications/gis/qgis { };

View file

@ -200,6 +200,9 @@ let
then self
else import ./stage.nix (args // { overlays = args.overlays ++ extraOverlays; });
# NOTE: each call to extend causes a full nixpkgs rebuild, adding ~130MB
# of allocations. DO NOT USE THIS IN NIXPKGS.
#
# Extend the package set with a single overlay. This preserves
# preexisting overlays. Prefer to initialize with the right overlays
# in one go when calling Nixpkgs, for performance and simplicity.