diff --git a/cabal-install/Distribution/Client/CmdRepl.hs b/cabal-install/Distribution/Client/CmdRepl.hs index d09597a8b91b89728434076d9bc8fa7142d3e7e8..662b7118991b7958c0de3ebd20b44a4edb859bb9 100644 --- a/cabal-install/Distribution/Client/CmdRepl.hs +++ b/cabal-install/Distribution/Client/CmdRepl.hs @@ -35,6 +35,8 @@ import Distribution.Client.ProjectConfig import Distribution.Client.ProjectOrchestration import Distribution.Client.ProjectPlanning ( ElaboratedSharedConfig(..), ElaboratedInstallPlan ) +import Distribution.Client.ProjectPlanning.Types + ( elabOrderExeDependencies ) import Distribution.Client.RebuildMonad ( runRebuild ) import Distribution.Client.Setup @@ -407,14 +409,20 @@ addDepsToProjectTarget deps pkgId ctx = generateReplFlags :: Bool -> ElaboratedInstallPlan -> OriginalComponentInfo -> ReplFlags generateReplFlags includeTransitive elaboratedPlan OriginalComponentInfo{..} = flags where + exeDeps :: [UnitId] + exeDeps = + foldMap + (InstallPlan.foldPlanPackage (const []) elabOrderExeDependencies) + (InstallPlan.dependencyClosure elaboratedPlan [ociUnitId]) + deps, deps', trans, trans' :: [UnitId] flags :: ReplFlags deps = installedUnitId <$> InstallPlan.directDeps elaboratedPlan ociUnitId deps' = deps \\ ociOriginalDeps trans = installedUnitId <$> InstallPlan.dependencyClosure elaboratedPlan deps' trans' = trans \\ ociOriginalDeps - flags = ("-package-id " ++) . prettyShow <$> - if includeTransitive then trans' else deps' + flags = fmap (("-package-id " ++) . prettyShow) . (\\ exeDeps) + $ if includeTransitive then trans' else deps' -- | This defines what a 'TargetSelector' means for the @repl@ command. -- It selects the 'AvailableTarget's that the 'TargetSelector' refers to,