From 9a9033148713548474f916fe078fc1b3389d278d Mon Sep 17 00:00:00 2001 From: Kosyrev Serge Date: Mon, 22 May 2017 13:49:01 +0300 Subject: [PATCH] [DEVOPS-36] review: add `builder-threads` parameter to default.nix (default to 8) --- default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index 4203b9f8be2..6b4e86cf168 100644 --- a/default.nix +++ b/default.nix @@ -1,5 +1,6 @@ { pkgs ? (import {}) , compiler ? pkgs.haskell.packages.ghc802 +, builder-threads ? 8 }: with (import { inherit pkgs;}); @@ -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