Commit 55fd868e authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Clean up, add comments.

parent 9f99e240
......@@ -16,6 +16,7 @@ import Stage
-- GhcPkg StageN, N > 0, is the one built in Stage0 (TODO: need only Stage1?)
-- TODO: add Cpp builders
-- TODO: rename Gcc to Cc?
-- TODO: do we really need staged builders?
data Builder = Alex
| Ar
| Gcc Stage
......
......@@ -19,6 +19,7 @@ newtype ArgsHashKey = ArgsHashKey Target
-- constructors are assumed not to examine target sources, but only append them
-- to argument lists where appropriate.
-- TODO: enforce the above assumption via type trickery?
-- TODO: Hash Target to improve accuracy and performance.
checkArgsHash :: Target -> Action ()
checkArgsHash target = when trackBuildSystem $ do
_ <- askOracle . ArgsHashKey $ target { sources = ["src"] } :: Action Int
......
......@@ -2,7 +2,7 @@ module Rules.Cabal (cabalRules) where
import Expression
import Data.Version
import Distribution.Package
import Distribution.Package hiding (Package)
import Distribution.PackageDescription
import Distribution.PackageDescription.Parse
import Distribution.Verbosity
......@@ -29,7 +29,9 @@ cabalRules = do
pkgDeps <- forM (sort pkgs) $ \pkg -> do
need [pkgCabalFile pkg]
pd <- liftIO . readPackageDescription silent $ pkgCabalFile pkg
let deps = collectDeps . condLibrary $ pd
let depsLib = collectDeps $ condLibrary pd
depsExes = map (collectDeps . Just . snd) $ condExecutables pd
deps = concat $ depsLib : depsExes
depNames = [ name | Dependency (PackageName name) _ <- deps ]
return . unwords $ Package.pkgName pkg : sort depNames
writeFileChanged out . unlines $ pkgDeps
......
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