Commit 67f433bf authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Compute package dependencies only for packages we build

See #265
parent 179f5b14
......@@ -16,7 +16,7 @@ cabalRules :: Rules ()
cabalRules = do
-- Cache boot package constraints (to be used in 'cabalArgs').
bootPackageConstraints %> \out -> do
bootPkgs <- interpretInContext (stageContext Stage0) getPackages
bootPkgs <- stagePackages Stage0
let pkgs = filter (\p -> p /= compiler && isLibrary p) bootPkgs
constraints <- forM (sort pkgs) $ \pkg -> do
need [pkgCabalFile pkg]
......@@ -28,7 +28,8 @@ cabalRules = do
-- Cache package dependencies.
packageDependencies %> \out -> do
pkgDeps <- forM (sort knownPackages) $ \pkg ->
pkgs <- concatMapM stagePackages [Stage0 .. Stage2]
pkgDeps <- forM (sort pkgs) $ \pkg ->
if pkg `elem` [hp2ps, libffi, rts, touchy, unlit]
then return $ pkgNameString pkg
else do
......
......@@ -23,7 +23,7 @@ testRules = do
"test" ~> do
let yesNo x = show $ if x then "YES" else "NO"
pkgs <- interpretInContext (stageContext Stage1) getPackages
pkgs <- stagePackages Stage1
tests <- filterM doesDirectoryExist $ concat
[ [ pkgPath pkg -/- "tests", pkgPath pkg -/- "tests-ghc" ]
| pkg <- pkgs, isLibrary pkg, pkg /= rts, pkg /= libffi ]
......
module Settings (
getArgs, getPackages, getLibraryWays, getRtsWays, flavour, knownPackages,
findKnownPackage, getPkgData, getPkgDataList, isLibrary, getPackagePath,
getContextDirectory, getBuildPath
getContextDirectory, getBuildPath, stagePackages
) where
import Base
......@@ -28,6 +28,9 @@ getRtsWays = fromDiffExpr $ rtsWays flavour
getPackages :: Expr [Package]
getPackages = fromDiffExpr $ packages flavour
stagePackages :: Stage -> Action [Package]
stagePackages stage = interpretInContext (stageContext stage) getPackages
getPackagePath :: Expr FilePath
getPackagePath = pkgPath <$> getPackage
......
......@@ -65,7 +65,6 @@ defaultBuilderArgs = mconcat
, makeBuilderArgs
, tarBuilderArgs ]
-- | All 'Package'-dependent command line arguments.
defaultPackageArgs :: Args
defaultPackageArgs = mconcat
......
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