Commit 6a9981ac authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Revert "Create inplace database upon configuration."

This reverts commit 351c1306.
parent 62526dd6
......@@ -480,6 +480,18 @@ benchmarkExeV10asExe bm@Benchmark { benchmarkInterface = BenchmarkExeV10 _ f }
}
benchmarkExeV10asExe Benchmark{} _ = error "benchmarkExeV10asExe: wrong kind"
-- | Initialize a new package db file for libraries defined
-- internally to the package.
createInternalPackageDB :: Verbosity -> LocalBuildInfo -> FilePath
-> IO PackageDB
createInternalPackageDB verbosity lbi distPref = do
existsAlready <- doesPackageDBExist dbPath
when existsAlready $ deletePackageDB dbPath
createPackageDB verbosity (compiler lbi) (withPrograms lbi) False dbPath
return (SpecificPackageDB dbPath)
where
dbPath = internalPackageDBPath lbi distPref
addInternalBuildTools :: PackageDescription -> LocalBuildInfo -> BuildInfo
-> ProgramDb -> ProgramDb
addInternalBuildTools pkg lbi bi progs =
......
......@@ -82,7 +82,6 @@ import Distribution.Simple.LocalBuildInfo
import Distribution.Types.LocalBuildInfo
import Distribution.Types.ComponentRequestedSpec
import Distribution.Simple.Utils
import Distribution.Simple.Register (createInternalPackageDB)
import Distribution.System
import Distribution.Version
import Distribution.Verbosity
......@@ -363,12 +362,10 @@ configure (pkg_descr0', pbi) cfg = do
checkExactConfiguration pkg_descr0 cfg
-- Where to build the package
let distPref :: FilePath -- e.g. dist
distPref = fromFlag (configDistPref cfg)
buildDir :: FilePath -- e.g. dist/build
let buildDir :: FilePath -- e.g. dist/build
-- fromFlag OK due to Distribution.Simple calling
-- findDistPrefOrDefault to fill it in
buildDir = distPref </> "build"
buildDir = fromFlag (configDistPref cfg) </> "build"
createDirectoryIfMissingVerbose (lessVerbose verbosity) True buildDir
-- What package database(s) to use
......@@ -706,9 +703,6 @@ configure (pkg_descr0', pbi) cfg = do
relocatable = reloc
}
-- Create the internal package database
_ <- createInternalPackageDB verbosity lbi distPref
when reloc (checkRelocatable verbosity pkg_descr lbi)
-- TODO: This is not entirely correct, because the dirs may vary
......
......@@ -31,7 +31,6 @@ module Distribution.Simple.Register (
unregister,
internalPackageDBPath,
createInternalPackageDB,
initPackageDB,
doesPackageDBExist,
......@@ -539,15 +538,3 @@ internalPackageDBPath lbi distPref =
case compilerFlavor (compiler lbi) of
UHC -> UHC.inplacePackageDbPath lbi
_ -> distPref </> "package.conf.inplace"
-- | Initialize a new package db file for libraries defined
-- internally to the package.
createInternalPackageDB :: Verbosity -> LocalBuildInfo -> FilePath
-> IO PackageDB
createInternalPackageDB verbosity lbi distPref = do
existsAlready <- doesPackageDBExist dbPath
when existsAlready $ deletePackageDB dbPath
createPackageDB verbosity (compiler lbi) (withPrograms lbi) False dbPath
return (SpecificPackageDB dbPath)
where
dbPath = internalPackageDBPath lbi distPref
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