You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are manually maintaining some kind of topological sort of the dependency DAG of our packages. Cabal already knows which things depend on which other things, we should use that knowledge.
We are not taking full advantage of build parallelism.
We could fix both of these by invoking cabal build just once, with all of our packages on the command line.
On (2): We may be building modules in parallel (I'm not sure if Cabal does this by default), but we're certainly not building packages in parallel, as we're not passing --jobs to Cabal, and the default is --jobs=1. We could even use --semaphore so that Cabal and GHC coordinate their use of parallelism for maximally fast builds.
Of course, parallelism begets nondeterminism, but parallel compiler invocations are fairly standard practice and shouldn't be too problematic. The trade-off for build speed is likely worth it.
The text was updated successfully, but these errors were encountered:
We may be building modules in parallel (I'm not sure if Cabal does this by default)
We do not build modules in parallel. This is something that is only done if you enable --semaphore explicitly (only supported in GHC 9.8 or later).
but we're certainly not building packages in parallel, as we're not passing --jobs to Cabal, and the default is --jobs=1.
I don't think this is quite right, as searching through the CI logs reveals that we are building packages in parallel. (See, for instance, this log.) The explanation behind this is that while --jobs' default value is 1, in practice cabal will create a default ~/.config/cabal/config file that has the following line:
jobs: $ncpus
I suppose it couldn't hurt to explicitly pass -j to cabal configure to make this more explicit.
Consider the following snippet from the Crux-LLVM CI build:
crucible/.github/workflows/crux-llvm-build.yml
Lines 124 to 137 in 2744ee5
This is suboptimal for two reasons:
We could fix both of these by invoking
cabal build
just once, with all of our packages on the command line.On (2): We may be building modules in parallel (I'm not sure if Cabal does this by default), but we're certainly not building packages in parallel, as we're not passing
--jobs
to Cabal, and the default is--jobs=1
. We could even use--semaphore
so that Cabal and GHC coordinate their use of parallelism for maximally fast builds.Of course, parallelism begets nondeterminism, but parallel compiler invocations are fairly standard practice and shouldn't be too problematic. The trade-off for build speed is likely worth it.
The text was updated successfully, but these errors were encountered: