summaryrefslogtreecommitdiff
path: root/hadrian/src/Settings/Builders/Common.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-08-21 19:34:36 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-09-14 17:17:04 -0400
commitb42cedbefb296437014d0768348b740b960943c0 (patch)
treeeb015b50669c6f4c778ae16a71b28522392e36dd /hadrian/src/Settings/Builders/Common.hs
parent98b62871581d09fd7f910f011b8309a342af9886 (diff)
downloadhaskell-b42cedbefb296437014d0768348b740b960943c0.tar.gz
hadrian: Inplace/Final package databases
There are now two different package databases per stage. An inplace package database contains .conf files which point directly into the build directories. The final package database contains .conf files which point into the installed locations. The inplace .conf files are created before any building happens and have fake ABI hash values. The final .conf files are created after a package finished building and contains the proper ABI has. The motivation for this is to make the dependency structure more fine-grained when building modules. Now a module depends just depends directly on M.o from package p rather than the .conf file depend on the .conf file for package p. So when all of a modules direct dependencies have finished building we can start building it rather than waiting for the whole package to finish. The secondary motivation is that the multi-repl doesn't need to build everything before starting the multi-repl session. We can just configure the inplace package-db and use that in order to start the repl.
Diffstat (limited to 'hadrian/src/Settings/Builders/Common.hs')
-rw-r--r--hadrian/src/Settings/Builders/Common.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/hadrian/src/Settings/Builders/Common.hs b/hadrian/src/Settings/Builders/Common.hs
index a011cb0dae..e89152be9e 100644
--- a/hadrian/src/Settings/Builders/Common.hs
+++ b/hadrian/src/Settings/Builders/Common.hs
@@ -53,15 +53,15 @@ cWarnings = mconcat
packageDatabaseArgs :: Args
packageDatabaseArgs = do
- stage <- getStage
- dbPath <- expr (packageDbPath stage)
+ loc <- getPackageDbLoc
+ dbPath <- expr (packageDbPath loc)
expr (need [dbPath -/- packageDbStamp])
prefix <- ifM (builder Ghc) (return "-package-db ") (return "--package-db=")
arg $ prefix ++ dbPath
bootPackageDatabaseArgs :: Args
bootPackageDatabaseArgs = do
- stage <- getStage
- dbPath <- expr $ packageDbPath stage
+ loc <- getPackageDbLoc
+ dbPath <- expr $ packageDbPath loc
expr $ need [dbPath -/- packageDbStamp]
stage0 ? packageDatabaseArgs