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

@ -280,6 +280,8 @@ Executable git-annex
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)