on iko/ghcjs-patch-master help sign in
Faster profiled builds (#623)
commit6c57d4f978867a69414362f6b5da64e4afbee32b authorMoritz Angermann <moritz.angermann@gmail.com> dateFri 22 May 2020, 21:50 (6 years ago) parent2819a93
2 files changed+5−3
builder/comp-builder.nix+4−2 builder/make-config-files.nix+1−1
builder/comp-builder.nix+4−2
@@ -1,6 +1,7 @@
11{ stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, ghcForComponent, hsPkgs, runCommand, libffi, gmp, zlib, ncurses, nodejs }:
22
33lib.makeOverridable (
4+let self =
45{ componentId
56, component
67, package
@@ -53,7 +54,7 @@ lib.makeOverridable (
5354
5455# Debug
5556, enableDebugRTS ? false
56−}:
57+}@drvArgs:
5758
5859let
5960 # TODO fix cabal wildcard support so hpack wildcards can be mapped to cabal wildcards
@@ -188,6 +189,7 @@ stdenv.mkDerivation ({
188189 # The directory containing the haddock documentation.
189190 # `null' if no haddock documentation was built.
190191 haddockDir = if doHaddock' then "${docdir drv.doc}/html" else null;
192+ profiled = self (drvArgs // { enableLibraryProfiling = true; });
191193 };
192194
193195 meta = {
@@ -379,4 +381,4 @@ stdenv.mkDerivation ({
379381 preInstall postInstall preHaddock postHaddock;
380382}
381383// lib.optionalAttrs (stdenv.buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${buildPackages.glibcLocales}/lib/locale/locale-archive"; }
382−)))
384+)); in self)
builder/make-config-files.nix+1−1
@@ -45,7 +45,7 @@ in { identifier, component, fullName, flags ? {}, needsProfiling ? false }:
4545 # Filters out only library packages that for this GHC target
4646 # TODO investigate why this is needed
4747 # TODO find out why p ? configFiles helps (for instance for `R1909.aarch64-unknown-linux-gnu.tests.cabal-22.run.x86_64-linux`)
48− let libDeps = (if needsProfiling then (x: map (p: p.override { enableLibraryProfiling = true; }) x) else x: x)
48+ let libDeps = (if needsProfiling then (x: map (p: p.profiled or p) x) else x: x)
4949 (lib.filter (p: (p ? configFiles) && p.configFiles.targetPrefix == ghc.targetPrefix)
5050 (map getLibComponent component.depends));
5151 cfgFiles =