Commit 0ca732ca authored by Oleg Grenrus's avatar Oleg Grenrus Committed by GitHub
Browse files

Merge pull request #4268 from Ericson2314/fix-filter-exes

Fix #4266
parents c621a78a 661db40f
...@@ -1367,20 +1367,27 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB ...@@ -1367,20 +1367,27 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
exeMap :: Map PackageName (Set UnqualComponentName) exeMap :: Map PackageName (Set UnqualComponentName)
exeMap = Map.fromListWith mappend exeKV exeMap = Map.fromListWith mappend exeKV
go (InstallPlan.Installed _) = error "unexpected state" go (InstallPlan.Installed _) = unexpectedState
go (InstallPlan.PreExisting _) = True go (InstallPlan.PreExisting _) = True
go (InstallPlan.Configured (ElaboratedConfiguredPackage { go (InstallPlan.Configured (ElaboratedConfiguredPackage {
elabPkgSourceId = PackageIdentifier { pkgName, .. }, elabPkgSourceId = PackageIdentifier { pkgName, .. },
elabPkgOrComp, elabPkgOrComp,
.. ..
})) = case elabPkgOrComp of })) = case elabPkgOrComp of
-- If we can only build the whole package or none of it, then we have
-- no choice and must build it all.
ElabPackage _ -> True ElabPackage _ -> True
-- If we can build specific components, lets just build the ones we
-- actually need.
ElabComponent comp' -> ElabComponent comp' ->
case Ty.compSolverName comp' of case Ty.compSolverName comp' of
CD.ComponentExe n CD.ComponentExe n -> case Map.lookup pkgName exeMap of
| Just set <- Map.lookup pkgName exeMap Just set -> Set.member n set
-> Set.member n set -- We may get unwanted components, but they should be from
_ -> error "unexpected state" -- packages we at least depended on.
Nothing -> unexpectedState
-- If it's not an exe component, it won't satisfy an exe dep
_ -> False
elaborateLibSolverId' :: (SolverId -> [ElaboratedPlanPackage]) elaborateLibSolverId' :: (SolverId -> [ElaboratedPlanPackage])
......
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