Skip to content

Commit

Permalink
cabal-install: justify why legacy-fallback is used
Browse files Browse the repository at this point in the history
This commit makes it so that cabal-install can explain the reason why
it used the legacy fallback, instead of building per-component.
  • Loading branch information
alt-romes authored and sheaf committed Nov 24, 2023
1 parent 6314590 commit 64829f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions cabal-install/src/Distribution/Client/ProjectBuilding.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1334,9 +1334,13 @@ buildAndInstallUnpackedPackage

dispname :: String
dispname = case elabPkgOrComp pkg of
ElabPackage _ ->
-- Packages built altogether, instead of per component
ElabPackage ElaboratedPackage{why_not_per_component} ->
prettyShow pkgid
++ " (all, legacy fallback)"
++ " (all, legacy fallback: "
++ unwords why_not_per_component
++ ")"
-- Packages built per component
ElabComponent comp ->
prettyShow pkgid
++ " ("
Expand Down
7 changes: 5 additions & 2 deletions cabal-install/src/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,7 @@ elaborateInstallPlan
else do
checkPerPackageOk comps not_per_component_reasons
return
[ elaborateSolverToPackage spkg g $
[ elaborateSolverToPackage (map prettyShow not_per_component_reasons) spkg g $
comps ++ maybeToList setupComponent
]
Left cns ->
Expand Down Expand Up @@ -2016,11 +2016,14 @@ elaborateInstallPlan
<$> executables

elaborateSolverToPackage
:: SolverPackage UnresolvedPkgLoc
:: [String]
-- \^ Reasons why this solver is not per component
-> SolverPackage UnresolvedPkgLoc
-> ComponentsGraph
-> [ElaboratedConfiguredPackage]
-> ElaboratedConfiguredPackage
elaborateSolverToPackage
why_not_per_component
pkg@( SolverPackage
(SourcePackage pkgid _gpd _srcloc _descOverride)
_flags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ data ElaboratedPackage = ElaboratedPackage
, pkgStanzasEnabled :: OptionalStanzaSet
-- ^ Which optional stanzas (ie testsuites, benchmarks) will actually
-- be enabled during the package configure step.
, why_not_per_component :: [String]
}
deriving (Eq, Show, Generic)

Expand Down

0 comments on commit 64829f3

Please sign in to comment.