Skip to content

Commit 2e7c4ab

Browse files
committed
Document the new rebuildInstallPlan return type
1 parent a305c09 commit 2e7c4ab

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

cabal-install/Distribution/Client/ProjectPlanning.hs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,27 @@ sanityCheckElaboratedConfiguredPackage sharedConfig
231231
-- * Deciding what to do: making an 'ElaboratedInstallPlan'
232232
------------------------------------------------------------------------------
233233

234+
-- | Return an up-to-date elaborated install plan and associated config.
235+
--
236+
-- Two variants of the install plan are returned: with and without packages
237+
-- from the store. That is, the \"improved\" plan where source packages are
238+
-- replaced by pre-existing installed packages from the store (when their ids
239+
-- match), and also the original elaborated plan which uses primarily source
240+
-- packages.
241+
242+
-- The improved plan is what we use for building, but the original elaborated
243+
-- plan is useful for reporting and configuration. For example the @freeze@
244+
-- command needs the source package info to know about flag choices and
245+
-- dependencies of executables and setup scripts.
246+
--
234247
rebuildInstallPlan :: Verbosity
235248
-> FilePath -> DistDirLayout -> CabalDirLayout
236249
-> ProjectConfig
237-
-> IO ( ElaboratedInstallPlan
238-
, ElaboratedInstallPlan
250+
-> IO ( ElaboratedInstallPlan -- with store packages
251+
, ElaboratedInstallPlan -- with source packages
239252
, ElaboratedSharedConfig
240253
, ProjectConfig )
254+
-- ^ @(improvedPlan, elaboratedPlan, _, _)@
241255
rebuildInstallPlan verbosity
242256
projectRootDir
243257
distDirLayout@DistDirLayout {

0 commit comments

Comments
 (0)