From 3f6aff89b1022b90c43a96b091d55e6e251d6f83 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 21 Sep 2023 13:00:31 -0400 Subject: [PATCH] enable parallel ghc for building git-annex This drops a full recompile on my new 12 core laptop from 4:00 to 2:47. It would be possible for me to use: cabal configure --ghc-options=-j But that also makes cabal parallelize ghc for each package it installs to satisfy git-annex's dependencies. Since cabal is already configured to parallize installing dependencies, that would use N^2 cpu cores, which seems like a bad idea. And also I'd have to remember to do it. So I'm thinking it's better to do it by default. If a system that is building git-annex is also busy with other things, let the scheduler sort it out. If this impacts someone particularly badly, they can of course avoid it with: cabal configure --ghc-options=-j1 --- git-annex.cabal | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git-annex.cabal b/git-annex.cabal index 4e72f93db5..5ba03e63ed 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -274,12 +274,14 @@ Executable git-annex network-bsd, git-lfs (>= 1.2.0) CC-Options: -Wall - GHC-Options: -Wall -fno-warn-tabs -Wincomplete-uni-patterns + GHC-Options: -Wall -fno-warn-tabs -Wincomplete-uni-patterns Default-Language: Haskell2010 Default-Extensions: LambdaCase Other-Extensions: TemplateHaskell -- Some things don't work with the non-threaded RTS. GHC-Options: -threaded + -- Build using all CPUs + GHC-Options: -j -- Fully optimize for production. if flag(Production)