diff --git a/builder/comp-builder.nix b/builder/comp-builder.nix index 8a071b8489..dce42bb9ec 100644 --- a/builder/comp-builder.nix +++ b/builder/comp-builder.nix @@ -1,6 +1,7 @@ { stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, ghcForComponent, hsPkgs, runCommand, libffi, gmp, zlib, ncurses, nodejs }: lib.makeOverridable ( +let self = { componentId , component , package @@ -53,7 +54,7 @@ lib.makeOverridable ( # Debug , enableDebugRTS ? false -}: +}@drvArgs: let # TODO fix cabal wildcard support so hpack wildcards can be mapped to cabal wildcards @@ -188,6 +189,7 @@ stdenv.mkDerivation ({ # The directory containing the haddock documentation. # `null' if no haddock documentation was built. haddockDir = if doHaddock' then "${docdir drv.doc}/html" else null; + profiled = self (drvArgs // { enableLibraryProfiling = true; }); }; meta = { @@ -379,4 +381,4 @@ stdenv.mkDerivation ({ preInstall postInstall preHaddock postHaddock; } // lib.optionalAttrs (stdenv.buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${buildPackages.glibcLocales}/lib/locale/locale-archive"; } -))) +)); in self) diff --git a/builder/make-config-files.nix b/builder/make-config-files.nix index 43156caa8d..e497fbae37 100644 --- a/builder/make-config-files.nix +++ b/builder/make-config-files.nix @@ -45,7 +45,7 @@ in { identifier, component, fullName, flags ? {}, needsProfiling ? false }: # Filters out only library packages that for this GHC target # TODO investigate why this is needed # TODO find out why p ? configFiles helps (for instance for `R1909.aarch64-unknown-linux-gnu.tests.cabal-22.run.x86_64-linux`) - let libDeps = (if needsProfiling then (x: map (p: p.override { enableLibraryProfiling = true; }) x) else x: x) + let libDeps = (if needsProfiling then (x: map (p: p.profiled or p) x) else x: x) (lib.filter (p: (p ? configFiles) && p.configFiles.targetPrefix == ghc.targetPrefix) (map getLibComponent component.depends)); cfgFiles =