Commit 300d9bad authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Add new style project building

This stage takes the ElaboratedInstallPlan and executes it. It does it
in two passes.

The first pass is the "dry run" pass where we work out which packages
and components within packages we actually need to build. If we are in
fact in --dry-run mode then of course this is the only pass we run, we
have enough info after this to accurately report on what we would do.

The first pass does the file monitor change stuff, which checks if
package config has changed and probes for package file changes. Based on
this we make a note of which phase of the build we would start at, up to
and including skipping building that package entirely. In the latter
case we replace the Configured package by a corresponding Installed

The first pass also prunes the ElaboratedInstallPlan based on the
targets that the user actually wants to build. For example we solve and
plan on the basis that the user might want to run the test suites or
benchmarks, but that doesn't mean we want to build them all the time
(they'll usually pull in additional deps). So there's a moderately
complex pass where we keep just the packages and components that are
needed to build the target components.

The first pass is moderately complicated but it makes no state changes
and just returns the updated ElaboratedInstallPlan, so it should make
things easier to debug.

The second phase has very little logic it just does what its told based
on all the earlier passes. For each package the dry run pass has worked
out which build step to start with, e.g. downloading, configuring or

The major cases the build phase has to deal with are packages that will
be built and installed to the store, vs packages that are local and so
are built inplace. It is only the latter that need all the complex
rebuild checking. In both cases all the "setup $cmd" flags are
calculated by the planning phase and we just do as we're told.
parent e869d803
This diff is collapsed.
......@@ -70,6 +70,7 @@ import qualified Distribution.Client.List as List
--TODO: temporary import, just to force these modules to be built.
-- It will be replaced by import of new build command once merged.
import Distribution.Client.ProjectPlanning ()
import Distribution.Client.ProjectBuilding ()
import Distribution.Client.Install (install)
import Distribution.Client.Configure (configure)
......@@ -182,6 +182,7 @@ executable cabal
......@@ -216,6 +217,7 @@ executable cabal
-- NOTE: when updating build-depends, don't forget to update version regexps
-- in
async >= 2.0 && < 3,
array >= 0.4 && < 0.6,
base >= 4.5 && < 5,
binary >= 0.5 && < 0.9,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment