Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
c7a9c6b8
Commit
c7a9c6b8
authored
Oct 13, 2016
by
Mikhail Glushenkov
Committed by
GitHub
Oct 13, 2016
Browse files
Merge pull request #3920 from dcoutts/project-orchestration-status
Initial impl of maintaining project build status
parents
5ee92d8b
68a8534d
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/ProjectOrchestration.hs
View file @
c7a9c6b8
...
...
@@ -61,6 +61,7 @@ import Distribution.Client.ProjectConfig
import
Distribution.Client.ProjectPlanning
import
Distribution.Client.ProjectPlanning.Types
import
Distribution.Client.ProjectBuilding
import
Distribution.Client.ProjectPlanOutput
import
Distribution.Client.Types
(
GenericReadyPackage
(
..
),
PackageLocation
(
..
)
)
...
...
@@ -128,12 +129,30 @@ data PreBuildHooks = PreBuildHooks {
-- | This holds the context between the pre-build, build and post-build phases.
--
data
ProjectBuildContext
=
ProjectBuildContext
{
projectRootDir
::
FilePath
,
distDirLayout
::
DistDirLayout
,
elaboratedPlan
::
ElaboratedInstallPlan
,
elaboratedShared
::
ElaboratedSharedConfig
,
pkgsBuildStatus
::
BuildStatusMap
,
buildSettings
::
BuildTimeSettings
projectRootDir
::
FilePath
,
distDirLayout
::
DistDirLayout
,
-- | This is the improved plan, before we select a plan subset based on
-- the build targets, and before we do the dry-run. So this contains
-- all packages in the project.
elaboratedPlanOriginal
::
ElaboratedInstallPlan
,
-- | This is the 'elaboratedPlanOriginal' after we select a plan subset
-- and do the dry-run phase to find out what is up-to or out-of date.
-- This is the plan that will be executed during the build phase. So
-- this contains only a subset of packages in the project.
elaboratedPlanToExecute
::
ElaboratedInstallPlan
,
-- | The part of the install plan that's shared between all packages in
-- the plan. This does not change between the two plan variants above,
-- so there is just the one copy.
elaboratedShared
::
ElaboratedSharedConfig
,
-- | The result of the dry-run phase. This tells us about each member of
-- the 'elaboratedPlanToExecute'.
pkgsBuildStatus
::
BuildStatusMap
,
buildSettings
::
BuildTimeSettings
}
...
...
@@ -203,7 +222,8 @@ runProjectPreBuildPhase
return
ProjectBuildContext
{
projectRootDir
,
distDirLayout
,
elaboratedPlan
=
elaboratedPlan''
,
elaboratedPlanOriginal
=
elaboratedPlan
,
elaboratedPlanToExecute
=
elaboratedPlan''
,
elaboratedShared
,
pkgsBuildStatus
,
buildSettings
...
...
@@ -226,7 +246,7 @@ runProjectBuildPhase verbosity ProjectBuildContext {..} =
fmap
(
Map
.
union
(
previousBuildOutcomes
pkgsBuildStatus
))
$
rebuildTargets
verbosity
distDirLayout
elaboratedPlan
elaboratedPlan
ToExecute
elaboratedShared
pkgsBuildStatus
buildSettings
...
...
@@ -259,9 +279,16 @@ runProjectPostBuildPhase verbosity ProjectBuildContext {..} buildOutcomes = do
-- - delete stale lib registrations
-- - delete stale package dirs
_postBuildStatus
<-
updatePostBuildProjectStatus
verbosity
distDirLayout
elaboratedPlanOriginal
pkgsBuildStatus
buildOutcomes
-- Finally if there were any build failures then report them and throw
-- an exception to terminate the program
dieOnBuildFailures
verbosity
elaboratedPlan
buildOutcomes
dieOnBuildFailures
verbosity
elaboratedPlan
ToExecute
buildOutcomes
-- Note that it is a deliberate design choice that the 'buildTargets' is
-- not passed to phase 1, and the various bits of input config is not
...
...
@@ -470,7 +497,7 @@ reportBuildTargetProblem (BuildTargetOptionalStanzaDisabled _) = undefined
printPlan
::
Verbosity
->
ProjectBuildContext
->
IO
()
printPlan
verbosity
ProjectBuildContext
{
elaboratedPlan
,
elaboratedPlanToExecute
=
elaboratedPlan
,
elaboratedShared
,
pkgsBuildStatus
,
buildSettings
=
BuildTimeSettings
{
buildSettingDryRun
}
...
...
cabal-install/Distribution/Client/ProjectPlanOutput.hs
View file @
c7a9c6b8
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment