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

Commit

Permalink
[DEVOPS-36] review: add builder-threads parameter to default.nix (d…
Browse files Browse the repository at this point in the history
…efault to 8)
  • Loading branch information
deepfire committed Jun 8, 2017
1 parent b01f36c commit 9a90331
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ pkgs ? (import <nixpkgs> {})
, compiler ? pkgs.haskell.packages.ghc802
, builder-threads ? 8
}:

with (import <nixpkgs/pkgs/development/haskell-modules/lib.nix> { inherit pkgs;});
Expand All @@ -11,13 +12,13 @@ let
});
socket-io-src = pkgs.fetchgit (removeAttrs (lib.importJSON ./pkgs/engine-io.json) ["date"]);
cardano-sl-src = pkgs.fetchgit (removeAttrs (lib.importJSON ./pkgs/cardano-sl.json) ["date"]);
cores = 4;
threads = 8;

builder-cores = builtins.div builder-threads 2;
buildSubset = subset: drv: overrideCabal drv (drv: {
buildTarget = subset;
});
buildSpeedupFlagsMarlowScaling = drv : appendConfigureFlag drv
"--ghc-option=-rtsopts --ghc-option=+RTS --ghc-option=-N${toString threads} --ghc-option=-A128m --ghc-option=-n2m --ghc-option=-qb0 --ghc-option=-qn${toString cores} --ghc-option=-RTS";
"--ghc-option=-rtsopts --ghc-option=+RTS --ghc-option=-N${toString builder-threads} --ghc-option=-A128m --ghc-option=-n2m --ghc-option=-qb0 --ghc-option=-qn${toString builder-cores} --ghc-option=-RTS";
in compiler.override {
overrides = self: super: {
# To generate these go to ./pkgs and run ./generate.sh
Expand Down

0 comments on commit 9a90331

Please sign in to comment.