Skip to content

Commit 7712505

Browse files
committed
Solver: Store names of required executables for build-tool-depends dependencies.
This commit changes the field of type 'IsExe' in the 'Dep' data type to type 'Maybe UnqualComponentName'. It also adds the executable name to error messages that previously just contained "(exe)".
1 parent cc95def commit 7712505

File tree

8 files changed

+74
-72
lines changed

8 files changed

+74
-72
lines changed

cabal-install/Distribution/Solver/Modular/Builder.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ addChildren bs@(BS { rdeps = rdm, next = OneGoal (StanzaGoal qsn@(SN qpn _) t gr
172172
-- and furthermore we update the set of goals.
173173
--
174174
-- TODO: We could inline this above.
175-
addChildren bs@(BS { next = Instance qpn (PInfo fdeps fdefs _) }) =
175+
addChildren bs@(BS { next = Instance qpn (PInfo fdeps _ fdefs _) }) =
176176
addChildren ((scopedExtendOpen qpn fdeps fdefs bs)
177177
{ next = Goals })
178178

cabal-install/Distribution/Solver/Modular/Dependency.hs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ module Distribution.Solver.Modular.Dependency (
1616
, FlaggedDep(..)
1717
, LDep(..)
1818
, Dep(..)
19-
, IsExe(..)
2019
, DependencyReason(..)
2120
, showDependencyReason
2221
, flattenFlaggedDeps
@@ -49,6 +48,7 @@ import qualified Distribution.Solver.Modular.ConflictSet as CS
4948

5049
import Distribution.Solver.Types.ComponentDeps (Component(..))
5150
import Distribution.Solver.Types.PackagePath
51+
import Distribution.Types.UnqualComponentName
5252

5353
{-------------------------------------------------------------------------------
5454
Constrained instances
@@ -99,10 +99,6 @@ flattenFlaggedDeps = concatMap aux
9999
type TrueFlaggedDeps qpn = FlaggedDeps qpn
100100
type FalseFlaggedDeps qpn = FlaggedDeps qpn
101101

102-
-- | Is this dependency on an executable
103-
newtype IsExe = IsExe Bool
104-
deriving (Eq, Show)
105-
106102
-- | A 'Dep' labeled with the reason it was introduced.
107103
--
108104
-- 'LDep' intentionally has no 'Functor' instance because the type variable
@@ -114,10 +110,10 @@ data LDep qpn = LDep (DependencyReason qpn) (Dep qpn)
114110
-- | A dependency (constraint) associates a package name with a constrained
115111
-- instance. It can also represent other types of dependencies, such as
116112
-- dependencies on language extensions.
117-
data Dep qpn = Dep IsExe qpn CI -- ^ dependency on a package (possibly for executable)
118-
| Ext Extension -- ^ dependency on a language extension
119-
| Lang Language -- ^ dependency on a language version
120-
| Pkg PkgconfigName VR -- ^ dependency on a pkg-config package
113+
data Dep qpn = Dep (Maybe UnqualComponentName) qpn CI -- ^ dependency on a package (possibly for executable)
114+
| Ext Extension -- ^ dependency on a language extension
115+
| Lang Language -- ^ dependency on a language version
116+
| Pkg PkgconfigName VR -- ^ dependency on a pkg-config package
121117
deriving Functor
122118

123119
-- | The reason that a dependency is active. It identifies the package and any
@@ -170,7 +166,7 @@ qualifyDeps QO{..} (Q pp@(PackagePath ns q) pn) = go
170166
-- Suppose package B has a setup dependency on package A.
171167
-- This will be recorded as something like
172168
--
173-
-- > LDep (DependencyReason "B") (Dep False "A" (Constrained AnyVersion))
169+
-- > LDep (DependencyReason "B") (Dep Nothing "A" (Constrained AnyVersion))
174170
--
175171
-- Observe that when we qualify this dependency, we need to turn that
176172
-- @"A"@ into @"B-setup.A"@, but we should not apply that same qualifier
@@ -182,13 +178,11 @@ qualifyDeps QO{..} (Q pp@(PackagePath ns q) pn) = go
182178
goD (Ext ext) _ = Ext ext
183179
goD (Lang lang) _ = Lang lang
184180
goD (Pkg pkn vr) _ = Pkg pkn vr
185-
goD (Dep is_exe dep ci) comp
186-
| isExeToBool is_exe = Dep is_exe (Q (PackagePath ns (QualExe pn dep)) dep) ci
187-
| qBase dep = Dep is_exe (Q (PackagePath ns (QualBase pn)) dep) ci
188-
| qSetup comp = Dep is_exe (Q (PackagePath ns (QualSetup pn)) dep) ci
189-
| otherwise = Dep is_exe (Q (PackagePath ns inheritedQ) dep) ci
190-
191-
isExeToBool (IsExe b) = b
181+
goD (Dep mExe dep ci) comp
182+
| isJust mExe = Dep mExe (Q (PackagePath ns (QualExe pn dep)) dep) ci
183+
| qBase dep = Dep mExe (Q (PackagePath ns (QualBase pn )) dep) ci
184+
| qSetup comp = Dep mExe (Q (PackagePath ns (QualSetup pn )) dep) ci
185+
| otherwise = Dep mExe (Q (PackagePath ns inheritedQ ) dep) ci
192186

193187
-- If P has a setup dependency on Q, and Q has a regular dependency on R, then
194188
-- we say that the 'Setup' qualifier is inherited: P has an (indirect) setup

cabal-install/Distribution/Solver/Modular/Index.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@ import Distribution.Solver.Modular.Dependency
1313
import Distribution.Solver.Modular.Flag
1414
import Distribution.Solver.Modular.Package
1515
import Distribution.Solver.Modular.Tree
16+
import Distribution.Types.UnqualComponentName
1617

1718
-- | An index contains information about package instances. This is a nested
1819
-- dictionary. Package names are mapped to instances, which in turn is mapped
1920
-- to info.
2021
type Index = Map PN (Map I PInfo)
2122

2223
-- | Info associated with a package instance.
23-
-- Currently, dependencies, flags and failure reasons.
24+
-- Currently, dependencies, executable names, flags and failure reasons.
2425
-- Packages that have a failure reason recorded for them are disabled
2526
-- globally, for reasons external to the solver. We currently use this
2627
-- for shadowing which essentially is a GHC limitation, and for
2728
-- installed packages that are broken.
28-
data PInfo = PInfo (FlaggedDeps PN) FlagInfo (Maybe FailReason)
29+
data PInfo = PInfo (FlaggedDeps PN) [UnqualComponentName] FlagInfo (Maybe FailReason)
2930

3031
mkIndex :: [(PN, I, PInfo)] -> Index
3132
mkIndex xs = M.map M.fromList (groupMap (L.map (\ (pn, i, pi) -> (pn, (i, pi))) xs))
@@ -39,7 +40,7 @@ defaultQualifyOptions idx = QO {
3940
| -- Find all versions of base ..
4041
Just is <- [M.lookup base idx]
4142
-- .. which are installed ..
42-
, (I _ver (Inst _), PInfo deps _flagNfo _fr) <- M.toList is
43+
, (I _ver (Inst _), PInfo deps _exes _flagNfo _fr) <- M.toList is
4344
-- .. and flatten all their dependencies ..
4445
, (LDep _ (Dep _is_exe dep _ci), _comp) <- flattenFlaggedDeps deps
4546
]

cabal-install/Distribution/Solver/Modular/IndexConversion.hs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ convIPI' (ShadowPkgs sip) idx =
7070
where
7171

7272
-- shadowing is recorded in the package info
73-
shadow (pn, i, PInfo fdeps fds _) | sip = (pn, i, PInfo fdeps fds (Just Shadowed))
74-
shadow x = x
73+
shadow (pn, i, PInfo fdeps exes fds _) | sip = (pn, i, PInfo fdeps exes fds (Just Shadowed))
74+
shadow x = x
7575

7676
-- | Extract/recover the the package ID from an installed package info, and convert it to a solver's I.
7777
convId :: InstalledPackageInfo -> (PN, I)
@@ -84,8 +84,8 @@ convId ipi = (pn, I ver $ Inst $ IPI.installedUnitId ipi)
8484
convIP :: SI.InstalledPackageIndex -> InstalledPackageInfo -> (PN, I, PInfo)
8585
convIP idx ipi =
8686
case mapM (convIPId (DependencyReason pn [] []) comp idx) (IPI.depends ipi) of
87-
Nothing -> (pn, i, PInfo [] M.empty (Just Broken))
88-
Just fds -> (pn, i, PInfo fds M.empty Nothing)
87+
Nothing -> (pn, i, PInfo [] [] M.empty (Just Broken))
88+
Just fds -> (pn, i, PInfo fds [] M.empty Nothing)
8989
where
9090
(pn, i) = convId ipi
9191
-- 'sourceLibName' is unreliable, but for now we only really use this for
@@ -131,7 +131,7 @@ convIPId dr comp idx ipid =
131131
case SI.lookupUnitId idx ipid of
132132
Nothing -> Nothing
133133
Just ipi -> let (pn, i) = convId ipi
134-
in Just (D.Simple (LDep dr (Dep (IsExe False) pn (Fixed i))) comp)
134+
in Just (D.Simple (LDep dr (Dep Nothing pn (Fixed i))) comp)
135135
-- NB: something we pick up from the
136136
-- InstalledPackageIndex is NEVER an executable
137137

@@ -192,7 +192,7 @@ convGPD os arch cinfo strfl solveExes pn
192192
addStanza :: Stanza -> DependencyReason pn -> DependencyReason pn
193193
addStanza s (DependencyReason pn' fs ss) = DependencyReason pn' fs (s : ss)
194194
in
195-
PInfo flagged_deps fds Nothing
195+
PInfo flagged_deps (L.map fst exes) fds Nothing
196196

197197
-- | Create a flagged dependency tree from a list @fds@ of flagged
198198
-- dependencies, using @f@ to form the tree node (@f@ will be
@@ -367,12 +367,11 @@ convBranch dr pkg os arch cinfo pn fds comp getInfo ipns solveExes (CondBranch c
367367

368368
-- | Convert a Cabal dependency on a library to a solver-specific dependency.
369369
convLibDep :: DependencyReason PN -> Dependency -> LDep PN
370-
convLibDep dr (Dependency pn vr) = LDep dr $ Dep (IsExe False) pn (Constrained vr)
370+
convLibDep dr (Dependency pn vr) = LDep dr $ Dep Nothing pn (Constrained vr)
371371

372-
-- | Convert a Cabal dependency on a executable (build-tools) to a solver-specific dependency.
373-
-- TODO do something about the name of the exe component itself
372+
-- | Convert a Cabal dependency on an executable (build-tools) to a solver-specific dependency.
374373
convExeDep :: DependencyReason PN -> ExeDependency -> LDep PN
375-
convExeDep dr (ExeDependency pn _ vr) = LDep dr $ Dep (IsExe True) pn (Constrained vr)
374+
convExeDep dr (ExeDependency pn exe vr) = LDep dr $ Dep (Just exe) pn (Constrained vr)
376375

377376
-- | Convert setup dependencies
378377
convSetupBuildInfo :: PN -> SetupBuildInfo -> FlaggedDeps PN

cabal-install/Distribution/Solver/Modular/Linking.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ validateLinking index = (`runReader` initVS) . cata go
9797
goP :: QPN -> POption -> Validate (Tree d c) -> Validate (Tree d c)
9898
goP qpn@(Q _pp pn) opt@(POption i _) r = do
9999
vs <- ask
100-
let PInfo deps _ _ = vsIndex vs ! pn ! i
101-
qdeps = qualifyDeps (vsQualifyOptions vs) qpn deps
102-
newSaved = M.insert qpn qdeps (vsSaved vs)
100+
let PInfo deps _ _ _ = vsIndex vs ! pn ! i
101+
qdeps = qualifyDeps (vsQualifyOptions vs) qpn deps
102+
newSaved = M.insert qpn qdeps (vsSaved vs)
103103
case execUpdateState (pickPOption qpn opt qdeps) vs of
104104
Left (cs, err) -> return $ Fail cs (DependenciesNotLinked err)
105105
Right vs' -> local (const vs' { vsSaved = newSaved }) r
@@ -346,7 +346,7 @@ verifyLinkGroup lg =
346346
-- if a constructor is added to the datatype we won't notice it here
347347
Just i -> do
348348
vs <- get
349-
let PInfo _deps finfo _ = vsIndex vs ! lgPackage lg ! i
349+
let PInfo _deps _exes finfo _ = vsIndex vs ! lgPackage lg ! i
350350
flags = M.keys finfo
351351
stanzas = [TestStanzas, BenchStanzas]
352352
forM_ flags $ \fn -> do

cabal-install/Distribution/Solver/Modular/Message.hs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import Distribution.Solver.Modular.Version
1919
import Distribution.Solver.Types.ConstraintSource
2020
import Distribution.Solver.Types.PackagePath
2121
import Distribution.Solver.Types.Progress
22+
import Distribution.Types.UnqualComponentName
2223

2324
data Message =
2425
Enter -- ^ increase indentation level
@@ -154,11 +155,13 @@ constraintSource :: ConstraintSource -> String
154155
constraintSource src = "constraint from " ++ showConstraintSource src
155156

156157
showConflictingDep :: ConflictingDep -> String
157-
showConflictingDep (ConflictingDep dr (IsExe is_exe) qpn (Fixed i) ) =
158+
showConflictingDep (ConflictingDep dr mExe qpn ci) =
158159
let DependencyReason qpn' _ _ = dr
159-
in (if qpn /= qpn' then showDependencyReason dr ++ " => " else "") ++
160-
showQPN qpn ++
161-
(if is_exe then " (exe) " else "") ++ "==" ++ showI i
162-
showConflictingDep (ConflictingDep dr (IsExe is_exe) qpn (Constrained vr)) =
163-
showDependencyReason dr ++ " => " ++ showQPN qpn ++
164-
(if is_exe then " (exe) " else "") ++ showVR vr
160+
exeStr = case mExe of
161+
Just exe -> " (exe " ++ unUnqualComponentName exe ++ ")"
162+
Nothing -> ""
163+
in case ci of
164+
Fixed i -> (if qpn /= qpn' then showDependencyReason dr ++ " => " else "") ++
165+
showQPN qpn ++ exeStr ++ "==" ++ showI i
166+
Constrained vr -> showDependencyReason dr ++ " => " ++ showQPN qpn ++
167+
exeStr ++ showVR vr

cabal-install/Distribution/Solver/Modular/Tree.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import qualified Distribution.Solver.Modular.WeightedPSQ as W
3030
import Distribution.Solver.Types.ConstraintSource
3131
import Distribution.Solver.Types.Flag
3232
import Distribution.Solver.Types.PackagePath
33+
import Distribution.Types.UnqualComponentName
3334
import Language.Haskell.Extension (Extension, Language)
3435

3536
type Weight = Double
@@ -118,7 +119,7 @@ data FailReason = UnsupportedExtension Extension
118119
deriving (Eq, Show)
119120

120121
-- | Information about a dependency involved in a conflict, for error messages.
121-
data ConflictingDep = ConflictingDep (DependencyReason QPN) IsExe QPN CI
122+
data ConflictingDep = ConflictingDep (DependencyReason QPN) (Maybe UnqualComponentName) QPN CI
122123
deriving (Eq, Show)
123124

124125
-- | Functor for the tree type. 'a' is the type of nodes' children. 'd' and 'c'

cabal-install/Distribution/Solver/Modular/Validate.hs

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import qualified Distribution.Solver.Modular.WeightedPSQ as W
3737

3838
import Distribution.Solver.Types.PackagePath
3939
import Distribution.Solver.Types.PkgConfigDb (PkgConfigDb, pkgConfigPkgIsPresent)
40+
import Distribution.Types.UnqualComponentName
4041

4142
#ifdef DEBUG_CONFLICT_SETS
4243
import GHC.Stack (CallStack)
@@ -124,16 +125,16 @@ data PreAssignment = PA PPreAssignment FAssignment SAssignment
124125
type PPreAssignment = Map QPN MergedPkgDep
125126

126127
-- | A dependency on a package, including its DependencyReason.
127-
data PkgDep = PkgDep (DependencyReason QPN) IsExe QPN CI
128+
data PkgDep = PkgDep (DependencyReason QPN) (Maybe UnqualComponentName) QPN CI
128129

129130
-- | MergedPkgDep records constraints about the instances that can still be
130131
-- chosen, and in the extreme case fixes a concrete instance. Otherwise, it is a
131132
-- list of version ranges paired with the goals / variables that introduced
132133
-- them. It also records whether a package is a build-tool dependency, for use
133134
-- in log messages.
134135
data MergedPkgDep =
135-
MergedDepFixed IsExe (DependencyReason QPN) I
136-
| MergedDepConstrained IsExe [VROrigin]
136+
MergedDepFixed (Maybe UnqualComponentName) (DependencyReason QPN) I
137+
| MergedDepConstrained (Maybe UnqualComponentName) [VROrigin]
137138

138139
-- | Version ranges paired with origins.
139140
type VROrigin = (VR, DependencyReason QPN)
@@ -185,7 +186,7 @@ validate = cata go
185186
svd <- asks saved -- obtain saved dependencies
186187
qo <- asks qualifyOptions
187188
-- obtain dependencies and index-dictated exclusions introduced by the choice
188-
let (PInfo deps _ mfr) = idx ! pn ! i
189+
let (PInfo deps _ _ mfr) = idx ! pn ! i
189190
-- qualify the deps in the current scope
190191
let qdeps = qualifyDeps qo qpn deps
191192
-- the new active constraints are given by the instance we have chosen,
@@ -328,9 +329,9 @@ extend extSupported langSupported pkgPresent newactives ppa = foldM extendSingle
328329
extendSingle a (LDep dr (Pkg pn vr)) =
329330
if pkgPresent pn vr then Right a
330331
else Left (dependencyReasonToCS dr, MissingPkgconfigPackage pn vr)
331-
extendSingle a (LDep dr (Dep is_exe qpn ci)) =
332-
let mergedDep = M.findWithDefault (MergedDepConstrained (IsExe False) []) qpn a
333-
in case (\ x -> M.insert qpn x a) <$> merge mergedDep (PkgDep dr is_exe qpn ci) of
332+
extendSingle a (LDep dr (Dep mExe qpn ci)) =
333+
let mergedDep = M.findWithDefault (MergedDepConstrained Nothing []) qpn a
334+
in case (\ x -> M.insert qpn x a) <$> merge mergedDep (PkgDep dr mExe qpn ci) of
334335
Left (c, (d, d')) -> Left (c, ConflictingConstraints d d')
335336
Right x -> Right x
336337

@@ -340,8 +341,8 @@ extendWithPackageChoice :: PI QPN
340341
-> PPreAssignment
341342
-> Either (ConflictSet, FailReason) PPreAssignment
342343
extendWithPackageChoice (PI qpn i) ppa =
343-
let mergedDep = M.findWithDefault (MergedDepConstrained (IsExe False) []) qpn ppa
344-
newChoice = PkgDep (DependencyReason qpn [] []) (IsExe False) qpn (Fixed i)
344+
let mergedDep = M.findWithDefault (MergedDepConstrained Nothing []) qpn ppa
345+
newChoice = PkgDep (DependencyReason qpn [] []) Nothing qpn (Fixed i)
345346
in case (\ x -> M.insert qpn x ppa) <$> merge mergedDep newChoice of
346347
Left (c, (d, _d')) -> -- Don't include the package choice in the
347348
-- FailReason, because it is redundant.
@@ -370,46 +371,49 @@ merge ::
370371
(?loc :: CallStack) =>
371372
#endif
372373
MergedPkgDep -> PkgDep -> Either (ConflictSet, (ConflictingDep, ConflictingDep)) MergedPkgDep
373-
merge (MergedDepFixed is_exe1 vs1 i1) (PkgDep vs2 is_exe2 p ci@(Fixed i2))
374-
| i1 == i2 = Right $ MergedDepFixed (mergeIsExe is_exe1 is_exe2) vs1 i1
374+
merge (MergedDepFixed mExe1 vs1 i1) (PkgDep vs2 mExe2 p ci@(Fixed i2))
375+
| i1 == i2 = Right $ MergedDepFixed (mergeExes mExe1 mExe2) vs1 i1
375376
| otherwise =
376377
Left ( (CS.union `on` dependencyReasonToCS) vs1 vs2
377-
, ( ConflictingDep vs1 is_exe1 p (Fixed i1)
378-
, ConflictingDep vs2 is_exe2 p ci ) )
378+
, ( ConflictingDep vs1 mExe1 p (Fixed i1)
379+
, ConflictingDep vs2 mExe2 p ci ) )
379380

380-
merge (MergedDepFixed is_exe1 vs1 i@(I v _)) (PkgDep vs2 is_exe2 p ci@(Constrained vr))
381-
| checkVR vr v = Right $ MergedDepFixed (mergeIsExe is_exe1 is_exe2) vs1 i
381+
merge (MergedDepFixed mExe1 vs1 i@(I v _)) (PkgDep vs2 mExe2 p ci@(Constrained vr))
382+
| checkVR vr v = Right $ MergedDepFixed (mergeExes mExe1 mExe2) vs1 i
382383
| otherwise =
383384
Left ( (CS.union `on` dependencyReasonToCS) vs1 vs2
384-
, ( ConflictingDep vs1 is_exe1 p (Fixed i)
385-
, ConflictingDep vs2 is_exe2 p ci ) )
385+
, ( ConflictingDep vs1 mExe1 p (Fixed i)
386+
, ConflictingDep vs2 mExe2 p ci ) )
386387

387-
merge (MergedDepConstrained is_exe1 vrOrigins) (PkgDep vs2 is_exe2 p ci@(Fixed i@(I v _))) =
388+
merge (MergedDepConstrained mExe1 vrOrigins) (PkgDep vs2 mExe2 p ci@(Fixed i@(I v _))) =
388389
go vrOrigins -- I tried "reverse vrOrigins" here, but it seems to slow things down ...
389390
where
390391
go :: [VROrigin] -> Either (ConflictSet, (ConflictingDep, ConflictingDep)) MergedPkgDep
391-
go [] = Right (MergedDepFixed (mergeIsExe is_exe1 is_exe2) vs2 i)
392+
go [] = Right (MergedDepFixed (mergeExes mExe1 mExe2) vs2 i)
392393
go ((vr, vs1) : vros)
393394
| checkVR vr v = go vros
394395
| otherwise =
395396
Left ( (CS.union `on` dependencyReasonToCS) vs1 vs2
396-
, ( ConflictingDep vs1 is_exe1 p (Constrained vr)
397-
, ConflictingDep vs2 is_exe2 p ci ) )
397+
, ( ConflictingDep vs1 mExe1 p (Constrained vr)
398+
, ConflictingDep vs2 mExe2 p ci ) )
398399

399-
merge (MergedDepConstrained is_exe1 vrOrigins) (PkgDep vs2 is_exe2 _ (Constrained vr)) =
400-
Right (MergedDepConstrained (mergeIsExe is_exe1 is_exe2) $
400+
merge (MergedDepConstrained mExe1 vrOrigins) (PkgDep vs2 mExe2 _ (Constrained vr)) =
401+
Right (MergedDepConstrained (mergeExes mExe1 mExe2) $
401402

402403
-- TODO: This line appends the new version range, to preserve the order used
403404
-- before a refactoring. Consider prepending the version range, if there is
404405
-- no negative performance impact.
405406
vrOrigins ++ [(vr, vs2)])
406407

407-
-- TODO: This function isn't correct, because cabal may need to build both libs
408-
-- and exes for a package. The merged value is only used to determine whether to
409-
-- print "(exe)" next to conflicts in log message, though. It should be removed
410-
-- when component-based solving is implemented.
411-
mergeIsExe :: IsExe -> IsExe -> IsExe
412-
mergeIsExe (IsExe ie1) (IsExe ie2) = IsExe (ie1 || ie2)
408+
-- TODO: This function isn't correct, because cabal may need to build libs
409+
-- and/or multiple exes for a package. The merged value is only used to
410+
-- determine whether to print the name of an exe next to conflicts in log
411+
-- message, though. It should be removed when component-based solving is
412+
-- implemented.
413+
mergeExes :: Maybe UnqualComponentName
414+
-> Maybe UnqualComponentName
415+
-> Maybe UnqualComponentName
416+
mergeExes = (<|>)
413417

414418
-- | Interface.
415419
validateTree :: CompilerInfo -> Index -> PkgConfigDb -> Tree d c -> Tree d c

0 commit comments

Comments
 (0)