on iko/ghcjs-patch-master help sign in
Faster profiled builds (#623)
6c57d4fMoritz Angermann
builder/comp-builder.nix+4−2
@@ -1,6 +1,7 @@
1{ stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, ghcForComponent, hsPkgs, runCommand, libffi, gmp, zlib, ncurses, nodejs }:
1{ stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, ghcForComponent, hsPkgs, runCommand, libffi, gmp, zlib, ncurses, nodejs }:
2
2
3lib.makeOverridable (
3lib.makeOverridable (
4+let self =
4{ componentId
5{ componentId
5, component
6, component
6, package
7, package
@@ -53,7 +54,7 @@ lib.makeOverridable (
53
54
54# Debug
55# Debug
55, enableDebugRTS ? false
56, enableDebugRTS ? false
56−}:
57+}@drvArgs:
57
58
58let
59let
59 # TODO fix cabal wildcard support so hpack wildcards can be mapped to cabal wildcards
60 # TODO fix cabal wildcard support so hpack wildcards can be mapped to cabal wildcards
@@ -188,6 +189,7 @@ stdenv.mkDerivation ({
188 # The directory containing the haddock documentation.
189 # The directory containing the haddock documentation.
189 # `null' if no haddock documentation was built.
190 # `null' if no haddock documentation was built.
190 haddockDir = if doHaddock' then "${docdir drv.doc}/html" else null;
191 haddockDir = if doHaddock' then "${docdir drv.doc}/html" else null;
192+ profiled = self (drvArgs // { enableLibraryProfiling = true; });
191 };
193 };
192
194
193 meta = {
195 meta = {
@@ -379,4 +381,4 @@ stdenv.mkDerivation ({
379 preInstall postInstall preHaddock postHaddock;
381 preInstall postInstall preHaddock postHaddock;
380}
382}
381// lib.optionalAttrs (stdenv.buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${buildPackages.glibcLocales}/lib/locale/locale-archive"; }
383// 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 }:
45 # Filters out only library packages that for this GHC target
45 # Filters out only library packages that for this GHC target
46 # TODO investigate why this is needed
46 # TODO investigate why this is needed
47 # TODO find out why p ? configFiles helps (for instance for `R1909.aarch64-unknown-linux-gnu.tests.cabal-22.run.x86_64-linux`)
47 # 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)
49 (lib.filter (p: (p ? configFiles) && p.configFiles.targetPrefix == ghc.targetPrefix)
49 (lib.filter (p: (p ? configFiles) && p.configFiles.targetPrefix == ghc.targetPrefix)
50 (map getLibComponent component.depends));
50 (map getLibComponent component.depends));
51 cfgFiles =
51 cfgFiles =