Skip to content

Commit

Permalink
Append paths in global config to progdb in configureCompiler
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Feb 10, 2025
1 parent 595d023 commit 45e2214
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cabal-install/src/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ configureCompiler
{ projectConfigHcFlavor
, projectConfigHcPath
, projectConfigHcPkg
, projectConfigProgPathExtra
}
, projectConfigLocalPackages =
PackageConfig
Expand All @@ -500,24 +501,26 @@ configureCompiler
$ do
liftIO $ info verbosity "Compiler settings changed, reconfiguring..."
let extraPath = fromNubList packageConfigProgramPathExtra
-- Add paths in the local config
progdb <- liftIO $ prependProgramSearchPath verbosity extraPath [] defaultProgramDb
let progdb' = userSpecifyPaths (Map.toList (getMapLast packageConfigProgramPaths)) progdb
result@(_, _, progdb'') <-
-- Add paths in the global config
progdb' <- liftIO $ prependProgramSearchPath verbosity (fromNubList projectConfigProgPathExtra) [] progdb
let progdb'' = userSpecifyPaths (Map.toList (getMapLast packageConfigProgramPaths)) progdb'
result@(_, _, progdb''') <-
liftIO $
Cabal.configCompilerEx
hcFlavor
hcPath
hcPkg
progdb'
progdb''
verbosity

-- Note that we added the user-supplied program locations and args
-- for /all/ programs, not just those for the compiler prog and
-- compiler-related utils. In principle we don't know which programs
-- the compiler will configure (and it does vary between compilers).
-- We do know however that the compiler will only configure the
-- programs it cares about, and those are the ones we monitor here.
monitorFiles (programsMonitorFiles progdb'')
monitorFiles (programsMonitorFiles progdb''')

-- Note: There is currently a bug here: we are dropping unconfigured
-- programs from the 'ProgramDb' when we re-use the cache created by
Expand Down

0 comments on commit 45e2214

Please sign in to comment.