Skip to content

Commit f2f7ee8

Browse files
committed
cabal-install configureCompiler: configure progdb
We should configure unconfigured programs before serialising them (using the Binary ProgramDb instance) in Distribution.Client.ProjectPlanning.configureCompiler, as otherwise we can accidentally discard information. This isn't currently a live bug, because in practice we end up re-running configuration steps when interfacing with the Cabal library. However, in the bright future in which we avoid re-configuring things when building a Cabal package that we already determined when invoking cabal-install, this starts causing problems.
1 parent b3ca7d4 commit f2f7ee8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ configureCompiler
483483
let extraPath = fromNubList packageConfigProgramPathExtra
484484
progdb <- liftIO $ prependProgramSearchPath verbosity extraPath [] defaultProgramDb
485485
let progdb' = userSpecifyPaths (Map.toList (getMapLast packageConfigProgramPaths)) progdb
486-
result@(_, _, progdb'') <-
486+
(comp, plat, progdb'') <-
487487
liftIO $
488488
Cabal.configCompilerEx
489489
hcFlavor
@@ -500,7 +500,12 @@ configureCompiler
500500
-- programs it cares about, and those are the ones we monitor here.
501501
monitorFiles (programsMonitorFiles progdb'')
502502

503-
return result
503+
-- Configure the unconfigured programs in the program database,
504+
-- as we can't serialise unconfigured programs.
505+
-- See also #2241 and #9840.
506+
finalProgDb <- liftIO $ configureAllKnownPrograms verbosity progdb''
507+
508+
return (comp, plat, finalProgDb)
504509
where
505510
hcFlavor = flagToMaybe projectConfigHcFlavor
506511
hcPath = flagToMaybe projectConfigHcPath

0 commit comments

Comments
 (0)