Skip to content

Commit 565e1a7

Browse files
committed
binPaths
1 parent 97a4fe5 commit 565e1a7

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

cabal-install/src/Distribution/Client/ProjectPlanning.hs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ module Distribution.Client.ProjectPlanning
106106

107107
-- TODO this is just to fix a warning
108108
, reportPlanningFailure
109+
, binPaths
109110
) where
110111

111112
import Distribution.Client.Compat.Prelude hiding (get)
@@ -2726,6 +2727,35 @@ binDirectories layout config package = case elabBuildStyle package of
27262727
distBuildDirectory layout (elabDistDirParams config package)
27272728
</> "build"
27282729

2730+
binPaths
2731+
:: DistDirLayout
2732+
-> ElaboratedSharedConfig
2733+
-> ElaboratedConfiguredPackage
2734+
-> [FilePath]
2735+
binPaths layout config package =
2736+
case package of
2737+
ElaboratedConfiguredPackage {
2738+
elabBuildStyle = BuildInplaceOnly _,
2739+
elabPkgOrComp = ElabComponent (ElaboratedComponent {compSolverName = CD.ComponentExe n})
2740+
} -> [root </> prettyShow n </> prettyShow n]
2741+
ElaboratedConfiguredPackage {
2742+
elabBuildStyle = BuildInplaceOnly _,
2743+
elabPkgOrComp = ElabPackage _
2744+
} ->
2745+
[ root </> prettyShow exeName </> prettyShow exeName
2746+
| exe <- PD.executables $ elabPkgDescription $ package
2747+
, let exeName = PD.exeName exe
2748+
]
2749+
ElaboratedConfiguredPackage {
2750+
elabBuildStyle = BuildAndInstall
2751+
} ->
2752+
[installedBinDirectory package]
2753+
_ -> []
2754+
where
2755+
root =
2756+
distBuildDirectory layout (elabDistDirParams config package)
2757+
</> "build"
2758+
27292759
type InstS = Map (WithStage UnitId) ElaboratedPlanPackage
27302760

27312761
type InstM a = StateT InstS LogProgress a

0 commit comments

Comments
 (0)