Commit 0a7dd80c authored by Alexis Williams's avatar Alexis Williams
Browse files

Use updated program DB.

parent 6843798b
...@@ -316,9 +316,9 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags) ...@@ -316,9 +316,9 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags)
(++ [ ProgramSearchPathDir dir (++ [ ProgramSearchPathDir dir
| dir <- fromNubList packageConfigProgramPathExtra ]) | dir <- fromNubList packageConfigProgramPathExtra ])
$ defaultProgramDb $ defaultProgramDb
(compiler@Compiler { compilerId = (compiler@Compiler { compilerId =
compilerId@(CompilerId compilerFlavor compilerVersion) }, platform, _) <- compilerId@(CompilerId compilerFlavor compilerVersion) }, platform, progDb') <-
configCompilerEx hcFlavor hcPath hcPkg progDb verbosity configCompilerEx hcFlavor hcPath hcPkg progDb verbosity
let let
...@@ -340,7 +340,7 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags) ...@@ -340,7 +340,7 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags)
cabalLayout = mkCabalDirLayout cabalDir mstoreDir mlogsDir cabalLayout = mkCabalDirLayout cabalDir mstoreDir mlogsDir
packageDbs = storePackageDBStack (cabalStoreDirLayout cabalLayout) compilerId packageDbs = storePackageDBStack (cabalStoreDirLayout cabalLayout) compilerId
installedIndex <- getInstalledPackages verbosity compiler packageDbs progDb installedIndex <- getInstalledPackages verbosity compiler packageDbs progDb'
let envSpecs = environmentFileToSpecifiers installedIndex envEntries let envSpecs = environmentFileToSpecifiers installedIndex envEntries
...@@ -408,19 +408,16 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags) ...@@ -408,19 +408,16 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags)
$ Map.toList $ targetsMap buildCtx $ Map.toList $ targetsMap buildCtx
runProjectPostBuildPhase verbosity baseCtx buildCtx buildOutcomes runProjectPostBuildPhase verbosity baseCtx buildCtx buildOutcomes
unless supportsPkgEnvFiles $ unless supportsPkgEnvFiles $ do
warn verbosity "The current compiler doesn't support safely installing libraries. (GHC 8.0+ only)" warn verbosity "The current compiler doesn't support safely installing libraries. (GHC 8.0+ only)"
let let
baseEntries = baseEntries =
GhcEnvFileClearPackageDbStack GhcEnvFileClearPackageDbStack : fmap GhcEnvFilePackageDb packageDbs
: fmap GhcEnvFilePackageDb packageDbs entries = baseEntries ++ entriesForLibraryComponents (targetsMap buildCtx)
entries = baseEntries ++ entriesForLibraryComponents (targetsMap buildCtx)
createDirectoryIfMissing True (takeDirectory envFile)
when supportsPkgEnvFiles $ do
let
entries' = nub (envEntries ++ entries) entries' = nub (envEntries ++ entries)
contents' = renderGhcEnvironmentFile entries' contents' = renderGhcEnvironmentFile entries'
createDirectoryIfMissing True (takeDirectory envFile)
writeFileAtomic envFile (BS.pack contents') writeFileAtomic envFile (BS.pack contents')
where where
configFlags' = disableTestsBenchsByDefault configFlags configFlags' = disableTestsBenchsByDefault configFlags
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment