Skip to content

Commit 45e2214

Browse files
committed
Append paths in global config to progdb in configureCompiler
1 parent 595d023 commit 45e2214

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

+8-5
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ configureCompiler
476476
{ projectConfigHcFlavor
477477
, projectConfigHcPath
478478
, projectConfigHcPkg
479+
, projectConfigProgPathExtra
479480
}
480481
, projectConfigLocalPackages =
481482
PackageConfig
@@ -500,24 +501,26 @@ configureCompiler
500501
$ do
501502
liftIO $ info verbosity "Compiler settings changed, reconfiguring..."
502503
let extraPath = fromNubList packageConfigProgramPathExtra
504+
-- Add paths in the local config
503505
progdb <- liftIO $ prependProgramSearchPath verbosity extraPath [] defaultProgramDb
504-
let progdb' = userSpecifyPaths (Map.toList (getMapLast packageConfigProgramPaths)) progdb
505-
result@(_, _, progdb'') <-
506+
-- Add paths in the global config
507+
progdb' <- liftIO $ prependProgramSearchPath verbosity (fromNubList projectConfigProgPathExtra) [] progdb
508+
let progdb'' = userSpecifyPaths (Map.toList (getMapLast packageConfigProgramPaths)) progdb'
509+
result@(_, _, progdb''') <-
506510
liftIO $
507511
Cabal.configCompilerEx
508512
hcFlavor
509513
hcPath
510514
hcPkg
511-
progdb'
515+
progdb''
512516
verbosity
513-
514517
-- Note that we added the user-supplied program locations and args
515518
-- for /all/ programs, not just those for the compiler prog and
516519
-- compiler-related utils. In principle we don't know which programs
517520
-- the compiler will configure (and it does vary between compilers).
518521
-- We do know however that the compiler will only configure the
519522
-- programs it cares about, and those are the ones we monitor here.
520-
monitorFiles (programsMonitorFiles progdb'')
523+
monitorFiles (programsMonitorFiles progdb''')
521524

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

0 commit comments

Comments
 (0)