Commit dee7e0a5 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Change regiserPackage to not require so much info

Drop the now-unused PackageDescription and inplace :: Bool args. And
instead of taking the whole LocalBuildInfo, just take the bits we need:
the compiler and program db. The package db stack was already passed in
separately. Also reorder args to follow standard conventions.
parent b0b57da9
......@@ -209,9 +209,8 @@ buildComponent verbosity numJobs pkg_descr lbi suffixes
installedPkgInfo = inplaceInstalledPackageInfo pwd distPref pkg_descr
(IPI.AbiHash "") lib' lbi clbi
registerPackage verbosity
installedPkgInfo pkg_descr lbi True -- True meaning in place
(withPackageDB lbi)
registerPackage verbosity (compiler lbi) (withPrograms lbi)
(withPackageDB lbi) installedPkgInfo
buildComponent verbosity numJobs pkg_descr lbi suffixes
comp@(CExe exe) clbi _ = do
......@@ -251,7 +250,8 @@ buildComponent verbosity numJobs pkg_descr lbi0 suffixes
extras <- preprocessExtras comp lbi
info verbosity $ "Building test suite " ++ testName test ++ "..."
buildLib verbosity numJobs pkg lbi lib libClbi
registerPackage verbosity ipi pkg lbi True $ withPackageDB lbi
registerPackage verbosity (compiler lbi) (withPrograms lbi)
(withPackageDB lbi) ipi
let ebi = buildInfo exe
exe' = exe { buildInfo = addExtraCSources ebi extras }
buildExe verbosity numJobs pkg_descr lbi exe' exeClbi
......@@ -116,7 +116,8 @@ register pkg@PackageDescription { library = Just lib } lbi regFlags
| modeGenerateRegScript -> writeRegisterScript installedPkgInfo
| otherwise -> do
setupMessage verbosity "Registering" (packageId pkg)
registerPackage verbosity installedPkgInfo pkg lbi inplace packageDbs
registerPackage verbosity (compiler lbi) (withPrograms lbi)
packageDbs installedPkgInfo
modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags))
......@@ -236,13 +237,12 @@ withHcPkg name comp conf f =
\not implemented for this compiler")
registerPackage :: Verbosity
-> InstalledPackageInfo
-> PackageDescription
-> LocalBuildInfo
-> Bool
-> Compiler
-> ProgramConfiguration
-> PackageDBStack
-> InstalledPackageInfo
-> IO ()
registerPackage verbosity installedPkgInfo _pkg lbi _inplace packageDbs = do
registerPackage verbosity comp progdb packageDbs installedPkgInfo = do
case compilerFlavor comp of
GHC -> GHC.registerPackage verbosity progdb packageDbs installedPkgInfo
GHCJS -> GHCJS.registerPackage verbosity progdb packageDbs installedPkgInfo
......@@ -252,9 +252,6 @@ registerPackage verbosity installedPkgInfo _pkg lbi _inplace packageDbs = do
HaskellSuite {} ->
HaskellSuite.registerPackage verbosity progdb packageDbs installedPkgInfo
_ -> die "Registering is not implemented for this compiler"
comp = compiler lbi
progdb = withPrograms lbi
writeHcPkgRegisterScript :: Verbosity
-> InstalledPackageInfo
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