File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
cabal-install/src/Distribution/Client Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,7 @@ withTempEnvFile verbosity baseCtx buildCtx buildStatus action = do
263263 action envOverrides
264264 )
265265
266+ -- | Get paths to all dependency executables to be included in PATH and log them.
266267pathAdditions :: Verbosity -> ProjectBaseContext -> ProjectBuildContext -> IO [FilePath ]
267268pathAdditions verbosity ProjectBaseContext {.. } ProjectBuildContext {.. } = do
268269 info verbosity . unlines $
@@ -274,6 +275,7 @@ pathAdditions verbosity ProjectBaseContext{..} ProjectBuildContext{..} = do
274275 S. toList $
275276 binDirectories distDirLayout elaboratedShared elaboratedPlanToExecute
276277
278+ -- | Get paths to all dependency executables to be included in PATH.
277279binDirectories
278280 :: DistDirLayout
279281 -> ElaboratedSharedConfig
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ import Distribution.Client.ProjectPlanning
5555 , binDirectoryFor
5656 )
5757import Distribution.Client.ProjectPlanning.Types
58- ( dataDirsEnvironmentForPlan
58+ ( dataDirsEnvironmentForPlan , elabExeDependencyPaths
5959 )
6060import Distribution.Client.ScriptUtils
6161 ( AcceptNoTargets (.. )
@@ -275,6 +275,12 @@ runAction flags@NixStyleFlags{..} targetAndArgs globalFlags =
275275 dieWithException verbosity $
276276 MultipleMatchingExecutables exeName (fmap (\ p -> " - in package " ++ prettyShow (elabUnitId p)) elabPkgs)
277277
278+ -- Some dependencies may have executables. Let's put those on the PATH.
279+ let extraPaths = elabExeDependencyPaths pkg
280+ info verbosity . unlines $
281+ " Including the following directories in PATH:"
282+ : extraPaths
283+
278284 let defaultExePath =
279285 binDirectoryFor
280286 (distDirLayout baseCtx)
@@ -300,6 +306,7 @@ runAction flags@NixStyleFlags{..} targetAndArgs globalFlags =
300306 dataDirsEnvironmentForPlan
301307 (distDirLayout baseCtx)
302308 elaboratedPlan
309+ , progInvokePathEnv = extraPaths
303310 }
304311 where
305312 (targetStr, args) = splitAt 1 targetAndArgs
Original file line number Diff line number Diff line change 1+ synopsis: Fix run command environment
2+ packages: cabal-install
3+ prs: #9341
4+ issues: #8391
5+
6+ description: {
7+
8+ - The Run command will now add binary paths of dependencies
9+ (build-tool-depends) to PATH, just like Exec and Test commands.
10+
11+ }
You can’t perform that action at this time.
0 commit comments