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
This commit is contained in:
Joey Hess 2023-09-21 13:00:31 -04:00
parent 54da44d42a
commit 3f6aff89b1
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -274,12 +274,14 @@ Executable git-annex
network-bsd, network-bsd,
git-lfs (>= 1.2.0) git-lfs (>= 1.2.0)
CC-Options: -Wall 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-Language: Haskell2010
Default-Extensions: LambdaCase Default-Extensions: LambdaCase
Other-Extensions: TemplateHaskell Other-Extensions: TemplateHaskell
-- Some things don't work with the non-threaded RTS. -- Some things don't work with the non-threaded RTS.
GHC-Options: -threaded GHC-Options: -threaded
-- Build using all CPUs
GHC-Options: -j
-- Fully optimize for production. -- Fully optimize for production.
if flag(Production) if flag(Production)