Commit 6d46b39a authored by Zhen Zhang's avatar Zhen Zhang Committed by Andrey Mokhov
Browse files

Fix setup-config dependency (#334)

parent edd539fc
......@@ -39,6 +39,8 @@ buildLib stage pkg = do
when (pkg `elem` activePackages) $
if isLibrary pkg
then do -- build a library
when (nonCabalContext context) $
need [pkgSetupConfigFile context]
ways <- interpretInContext context getLibraryWays
libs <- mapM (pkgLibraryFile . Context stage pkg) ways
docs <- interpretInContext context $ buildHaddock flavour
......
......@@ -20,8 +20,9 @@ buildPackageData context@Context {..} = do
cabalFile = pkgCabalFile package
configure = pkgPath package -/- "configure"
dataFile = pkgDataFile context
setupConfigFile = pkgSetupConfigFile context
dataFile %> \mk -> do
[dataFile, setupConfigFile] &%> \(mk:setupConfig:_) -> do
-- Make sure all generated dependencies are in place before proceeding.
orderOnly =<< interpretInContext context generatedDependencies
......@@ -32,7 +33,7 @@ buildPackageData context@Context {..} = do
need =<< mapM pkgConfFile =<< contextDependencies context
need [cabalFile]
build $ Target context GhcCabal [cabalFile] [mk]
build $ Target context GhcCabal [cabalFile] [mk, setupConfig]
postProcessPackageData context mk
pkgInplaceConfig context %> \conf -> do
......@@ -107,6 +108,7 @@ packageCmmSources pkg
-- For example, @libraries/deepseq/dist-install_VERSION = 1.4.0.0@
-- is replaced by @VERSION = 1.4.0.0@.
-- Reason: Shake's built-in makefile parser doesn't recognise slashes
-- TODO (izgzhen): should fix DEP_LIB_REL_DIRS_SEARCHPATH
postProcessPackageData :: Context -> FilePath -> Action ()
postProcessPackageData context@Context {..} file = do
top <- topDirectory
......
......@@ -18,7 +18,7 @@ import Oracles.Config.Setting
import Oracles.PackageData
import Oracles.Path
import qualified System.Directory.Extra as IO
import qualified System.Directory as IO
{- | Install the built binaries etc. to the @destDir ++ prefix@.
......@@ -133,6 +133,7 @@ withLatestBuildStage pkg m = do
installPackageConf :: Action ()
installPackageConf = do
let context = vanillaContext Stage0 rts
liftIO $ IO.createDirectoryIfMissing True (takeDirectory pkgConfInstallPath)
build $ Target context HsCpp [ pkgPath rts -/- "package.conf.in" ]
[ pkgConfInstallPath <.> "raw" ]
Stdout out <- cmd ("grep" :: String) [ "-v", "^#pragma GCC"
......
......@@ -5,7 +5,8 @@ module Settings.Path (
rtsContext, rtsBuildPath, rtsConfIn, shakeFilesPath,inplacePackageDbDirectory,
pkgConfFile, packageDbStamp, bootPackageConstraints, packageDependencies,
objectPath, inplaceBinPath, inplaceLibBinPath, inplaceLibPath,
installPath, autogenPath, pkgInplaceConfig, ghcSplitPath, stripCmdPath
installPath, autogenPath, pkgInplaceConfig, ghcSplitPath, stripCmdPath,
pkgSetupConfigFile
) where
import Base
......@@ -74,6 +75,11 @@ pkgInplaceConfig context = buildPath context -/- "inplace-pkg-config"
pkgDataFile :: Context -> FilePath
pkgDataFile context = buildPath context -/- "package-data.mk"
-- | Path to the @setup-config@ of a given 'Context'.
pkgSetupConfigFile :: Context -> FilePath
pkgSetupConfigFile context = buildPath context -/- "setup-config"
-- | Path to the haddock file of a given 'Context', e.g.:
-- "_build/stage1/libraries/array/doc/html/array/array.haddock".
pkgHaddockFile :: Context -> FilePath
......
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