Configure the compiler ProgramDb once per project#11768
Configure the compiler ProgramDb once per project#11768sheaf wants to merge 1 commit intohaskell:masterfrom
Conversation
f4bd9b8 to
7cfb145
Compare
|
This really looks tricky --- so few changes, but such a great effect. Would it possible to add some tests that try to break things by performing a few scenarios that previously took many configuration invocations and now that just one? Maybe to these twice for a good measure? A question: does the "once per project" mean once per project per cabal run, or until |
| $ projectConfigProvenance projectConfig | ||
| ] | ||
|
|
||
| configureCompiler |
There was a problem hiding this comment.
Are you able to add haddocks to configureCompiler, including what is in ProgramDb and when it is set up and cleared?
| , projectConfigBuildOnly | ||
| } | ||
| (compiler, platform, progdb) | ||
| (compiler, platform, compilerprogdb) |
There was a problem hiding this comment.
The absence of a casing change in compilerprogdb is a bit odd. Maybe compilerProgDb? Is there a problem with the progdb name?
There was a problem hiding this comment.
This one could be called unconfiguredProgDb and the other one progdb or progDb, once configured.
| -> Platform | ||
| -> Compiler | ||
| -> ProgramDb | ||
| -- ^ **Configured** compiler program database (ghc, ghc-pkg, haddock, ld, etc) |
There was a problem hiding this comment.
This doesn't render well:
Is that markdown bold in place of haddocks bold?
@@ -1640,7 +1641,7 @@ elaborateInstallPlan
-> Platform
-> Compiler
-> ProgramDb
- -- ^ **Configured** compiler program database (ghc, ghc-pkg, haddock, ld, etc)
+ -- ^ __Configured__ compiler program database (ghc, ghc-pkg, haddock, ld, etc)
-> Maybe PkgConfigDb| prependProgramSearchPath verbosity | ||
| (useExtraPathEnv options) | ||
| (useExtraEnvOverrides options) =<< | ||
| mkProgramDb verbHandles flags -- Passes user-supplied arguments to e.g. GHC |
There was a problem hiding this comment.
Is the comment "Passes user-supplied arguments to e.g. GHC" no longer relevant?
There was a problem hiding this comment.
That's part of configuring a program, isn't it?
cabal/Cabal/src/Distribution/Simple/Program/Db.hs
Lines 397 to 404 in 5ac41c2
This PR ensures we configure the compiler program database (constituted of
ghcand attendant programs such asghc-pkg,haddock, toolchain programs such asar,ldetc) ahead of time withincabal-install, so that we don't need to reconfigure programs such asghc,ghc-pkg,haddocketc once per package within Cabal.This should be a net performance win without any other change in behaviour.
Template Α: This PR modifies behaviour or interface
BuildToolPathsensure we don't regress when users pass--with-alex(for example).