Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

[DEVOPS-1032] nix: Add flag to build with optimization disabled #3544

Merged
merged 2 commits into from
Sep 13, 2018
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
12 changes: 11 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ in
, enablePhaseMetrics ? true
, allowCustomConfig ? true
, useStackBinaries ? false
, fasterBuild ? false
}:

with pkgs.lib;
Expand Down Expand Up @@ -111,6 +112,14 @@ let
});
};

# Disabling optimization for cardano-sl packages will
# return a build ~20% faster (measured in DEVOPS-1032).
fasterBuildOverlay = self: super: {
mkDerivation = args: super.mkDerivation (args // optionalAttrs (localLib.isCardanoSL args.pname) {
configureFlags = (args.configureFlags or []) ++ [ "--ghc-options=-O0" ];
});
};

dontCheckOverlay = self: super: {
mkDerivation = args: super.mkDerivation (args // {
doCheck = false;
Expand All @@ -133,7 +142,8 @@ let
++ optional enablePhaseMetrics metricOverlay
++ optional enableBenchmarks benchmarkOverlay
++ optional enableDebugging debugOverlay
++ optional forceDontCheck dontCheckOverlay;
++ optional forceDontCheck dontCheckOverlay
++ optional fasterBuild fasterBuildOverlay;

cardanoPkgs = builtins.foldl' (pkgs: overlay: pkgs.extend overlay) cardanoPkgsBase activeOverlays;
connect = let
Expand Down
2 changes: 2 additions & 0 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ in
{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
, scrubJobs ? true
, cardano ? { outPath = ./.; rev = "abcdef"; }
, fasterBuild ? false
, nixpkgsArgs ? {
config = { allowUnfree = false; inHydra = true; };
gitrev = cardano.rev;
inherit fasterBuild;
}
}:

Expand Down