Skip to content

Commit

Permalink
Modularise configure step
Browse files Browse the repository at this point in the history
This commit modularises the configure phase (i.e. the function
Distribution.Simple.Configure.configure). The aim of this change
is to make explicit the control flow of the function: it starts off
with a package-wide phase, and then componentwise configuration.
  • Loading branch information
sheaf committed Nov 27, 2023
1 parent df3f7a6 commit c6b4775
Show file tree
Hide file tree
Showing 5 changed files with 651 additions and 473 deletions.
4 changes: 2 additions & 2 deletions Cabal/src/Distribution/Backpack/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ configureComponentLocalBuildInfos
cid_flag
pkg_descr
(prePkgDeps, promisedPkgDeps)
flagAssignment
flags
instantiate_with
installedPackageSet
comp = do
Expand Down Expand Up @@ -123,7 +123,7 @@ configureComponentLocalBuildInfos
graph1 <-
toConfiguredComponents
use_external_internal_deps
flagAssignment
flags
deterministic
ipid_flag
cid_flag
Expand Down
4 changes: 2 additions & 2 deletions Cabal/src/Distribution/Simple/BuildTarget.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,11 @@ checkBuildTargets _ pkg_descr lbi [] =
checkBuildTargets
verbosity
pkg_descr
lbi@(LocalBuildInfo{componentEnabledSpec})
lbi@(LocalBuildInfo{componentEnabledSpec = enabledComps})
targets = do
let (enabled, disabled) =
partitionEithers
[ case componentDisabledReason componentEnabledSpec comp of
[ case componentDisabledReason enabledComps comp of
Nothing -> Left target'
Just reason -> Right (cname, reason)
| target <- targets
Expand Down
Loading

0 comments on commit c6b4775

Please sign in to comment.