Skip to content

Faster profiled builds #623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions builder/comp-builder.nix
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion builder/make-config-files.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down