Commit 4220ffb5 authored by Edward Z. Yang's avatar Edward Z. Yang Committed by Edward Z. Yang
Browse files

Restore BC for initialBuildSteps.



Fixes #4273.
Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 8977b657
......@@ -23,6 +23,7 @@ module Distribution.Simple.Build (
startInterpreter,
initialBuildSteps,
componentInitialBuildSteps,
writeAutogenFiles,
) where
......@@ -105,7 +106,7 @@ build pkg_descr lbi flags suffixes = do
(\f -> foldM_ f (installedPkgs lbi) componentsToBuild) $ \index target -> do
let comp = targetComponent target
clbi = targetCLBI target
initialBuildSteps distPref pkg_descr lbi clbi verbosity
componentInitialBuildSteps distPref pkg_descr lbi clbi verbosity
let bi = componentBuildInfo comp
progs' = addInternalBuildTools pkg_descr lbi bi (withPrograms lbi)
lbi' = lbi {
......@@ -157,7 +158,7 @@ repl pkg_descr lbi flags suffixes args = do
[ do let clbi = targetCLBI subtarget
comp = targetComponent subtarget
lbi' = lbiForComponent comp lbi
initialBuildSteps distPref pkg_descr lbi clbi verbosity
componentInitialBuildSteps distPref pkg_descr lbi clbi verbosity
buildComponent verbosity NoFlag
pkg_descr lbi' suffixes comp clbi distPref
| subtarget <- init componentsToBuild ]
......@@ -166,7 +167,7 @@ repl pkg_descr lbi flags suffixes args = do
let clbi = targetCLBI target
comp = targetComponent target
lbi' = lbiForComponent comp lbi
initialBuildSteps distPref pkg_descr lbi clbi verbosity
componentInitialBuildSteps distPref pkg_descr lbi clbi verbosity
replComponent verbosity pkg_descr lbi' suffixes comp clbi distPref
......@@ -605,13 +606,24 @@ replFLib verbosity pkg_descr lbi exe clbi =
GHC -> GHC.replFLib verbosity NoFlag pkg_descr lbi exe clbi
_ -> die "A REPL is not supported for this compiler."
-- | Runs 'componentInitialBuildSteps' on every configured component.
initialBuildSteps :: FilePath -- ^"dist" prefix
-> PackageDescription -- ^mostly information from the .cabal file
-> LocalBuildInfo -- ^Configuration information
-> Verbosity -- ^The verbosity to use
-> IO ()
initialBuildSteps distPref pkg_descr lbi verbosity =
withAllComponentsInBuildOrder pkg_descr lbi $ \_comp clbi ->
componentInitialBuildSteps distPref pkg_descr lbi clbi verbosity
-- | Creates the autogenerated files for a particular configured component.
componentInitialBuildSteps :: FilePath -- ^"dist" prefix
-> PackageDescription -- ^mostly information from the .cabal file
-> LocalBuildInfo -- ^Configuration information
-> ComponentLocalBuildInfo
-> Verbosity -- ^The verbosity to use
-> IO ()
initialBuildSteps _distPref pkg_descr lbi clbi verbosity = do
componentInitialBuildSteps _distPref pkg_descr lbi clbi verbosity = do
createDirectoryIfMissingVerbose verbosity True (componentBuildDir lbi clbi)
writeAutogenFiles verbosity pkg_descr lbi clbi
......
......@@ -194,7 +194,7 @@ haddock pkg_descr lbi suffixes flags' = do
, fromPackageDescription haddockTarget pkg_descr ]
withAllComponentsInBuildOrder pkg_descr lbi $ \component clbi -> do
initialBuildSteps (flag haddockDistPref) pkg_descr lbi clbi verbosity
componentInitialBuildSteps (flag haddockDistPref) pkg_descr lbi clbi verbosity
preprocessComponent pkg_descr component lbi clbi False verbosity suffixes
let
doExe com = case (compToExe com) of
......@@ -682,7 +682,7 @@ hscolour' onNoHsColour haddockTarget pkg_descr lbi suffixes flags =
hscolourPref haddockTarget distPref pkg_descr
withAllComponentsInBuildOrder pkg_descr lbi $ \comp clbi -> do
initialBuildSteps distPref pkg_descr lbi clbi verbosity
componentInitialBuildSteps distPref pkg_descr lbi clbi verbosity
preprocessComponent pkg_descr comp lbi clbi False verbosity suffixes
let
doExe com = case (compToExe com) of
......
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