diff --git a/cabal-install/src/Distribution/Client/ProjectConfig.hs b/cabal-install/src/Distribution/Client/ProjectConfig.hs index 645ebe6f621..b71cc77f1dc 100644 --- a/cabal-install/src/Distribution/Client/ProjectConfig.hs +++ b/cabal-install/src/Distribution/Client/ProjectConfig.hs @@ -109,7 +109,7 @@ import Distribution.Client.Types.SourceRepo import Distribution.Simple.Compiler ( Compiler, compilerInfo ) import Distribution.Simple.Program - ( ConfiguredProgram(..) ) + ( Program(..), ConfiguredProgram(..), ProgramSearchPathEntry(..), findProgramOnSearchPath ) import Distribution.Simple.Setup ( Flag(Flag), toFlag, flagToMaybe, flagToList , fromFlag, fromFlagOrDefault ) @@ -1139,11 +1139,16 @@ syncAndReadSourcePackagesRemoteRepos verbosity [ ((rtype, rloc), [(repo, vcsRepoType vcs)]) | (repo, rloc, rtype, vcs) <- repos' ] - --TODO: pass progPathExtra on to 'configureVCS' - let _progPathExtra = fromNubList projectConfigProgPathExtra + let progPathExtra = fromNubList projectConfigProgPathExtra getConfiguredVCS <- delayInitSharedResources $ \repoType -> - let vcs = Map.findWithDefault (error $ "Unknown VCS: " ++ prettyShow repoType) repoType knownVCSs in - configureVCS verbosity {-progPathExtra-} vcs + let vcs = Map.findWithDefault (error $ "Unknown VCS: " ++ prettyShow repoType) repoType knownVCSs + vcsProgramName = programName (vcsProgram vcs) + vcs2 = vcs {vcsProgram = (vcsProgram vcs) {programFindLocation = findProgramOnExtraPath}} + findProgramOnExtraPath v p = do + r1 <- findProgramOnSearchPath v (map ProgramSearchPathDir progPathExtra) vcsProgramName + r2 <- findProgramOnSearchPath v p vcsProgramName + return (r1 <|> r2) + in configureVCS verbosity vcs2 concat <$> sequenceA [ rerunIfChanged verbosity monitor repoGroup' $ do diff --git a/changelog.d/pr-8538 b/changelog.d/pr-8538 new file mode 100644 index 00000000000..afdad392f9b --- /dev/null +++ b/changelog.d/pr-8538 @@ -0,0 +1,3 @@ +synopsis: Look into ~/.cabal/bin when searching for VCS programs +packages: cabal-install +prs: #8538