summaryrefslogtreecommitdiff
path: root/hadrian/src/Rules
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-11-22 08:50:45 -0500
committerBen Gamari <ben@smart-cactus.org>2017-11-22 08:50:45 -0500
commitabdb5559b74af003a6d85f32695c034ff739f508 (patch)
tree1d3df93568e0db2c00acfa14a89f52db6b8df5f2 /hadrian/src/Rules
parentc11f145cf6a32337c005b0f9185e228c9ade0a64 (diff)
parent360d7404809b3fa54541f7f932a6864294f75a4a (diff)
downloadhaskell-abdb5559b74af003a6d85f32695c034ff739f508.tar.gz
Update Hadrian
Diffstat (limited to 'hadrian/src/Rules')
-rw-r--r--hadrian/src/Rules/Compile.hs2
-rw-r--r--hadrian/src/Rules/Dependencies.hs4
-rw-r--r--hadrian/src/Rules/Program.hs3
3 files changed, 2 insertions, 7 deletions
diff --git a/hadrian/src/Rules/Compile.hs b/hadrian/src/Rules/Compile.hs
index a4b1278660..b7f3bc8447 100644
--- a/hadrian/src/Rules/Compile.hs
+++ b/hadrian/src/Rules/Compile.hs
@@ -22,8 +22,6 @@ compilePackage rs context@Context {..} = do
path <- buildPath context
(src, deps) <- lookupDependencies (path -/- ".dependencies") obj
need $ src : deps
- when (isLibrary package) $ need =<< return <$> pkgConfFile context
- needLibrary =<< contextDependencies context
buildWithResources rs $ target context (Ghc CompileHs stage) [src] [obj]
priority 2.0 $ do
diff --git a/hadrian/src/Rules/Dependencies.hs b/hadrian/src/Rules/Dependencies.hs
index f27ef0d912..f9d17e93d8 100644
--- a/hadrian/src/Rules/Dependencies.hs
+++ b/hadrian/src/Rules/Dependencies.hs
@@ -19,11 +19,11 @@ buildPackageDependencies rs context@Context {..} =
orderOnly =<< interpretInContext context generatedDependencies
let mk = deps <.> "mk"
if null srcs
- then writeFileChanged mk ""
+ then writeFile' mk ""
else buildWithResources rs $
target context (Ghc FindHsDependencies stage) srcs [mk]
removeFile $ mk <.> "bak"
- mkDeps <- readFile' mk
+ mkDeps <- liftIO $ readFile mk
writeFileChanged deps . unlines
. map (\(src, deps) -> unwords $ src : deps)
. map (bimap unifyPath (map unifyPath))
diff --git a/hadrian/src/Rules/Program.hs b/hadrian/src/Rules/Program.hs
index ba4dab0442..dca177f879 100644
--- a/hadrian/src/Rules/Program.hs
+++ b/hadrian/src/Rules/Program.hs
@@ -92,7 +92,6 @@ buildWrapper context@Context {..} wrapper wrapperPath wrapped = do
putSuccess $ "| Successfully created wrapper for " ++
quote (pkgName package) ++ " (" ++ show stage ++ ")."
--- TODO: Get rid of the Paths_hsc2hs.o hack.
buildBinary :: [(Resource, Int)] -> FilePath -> Context -> Action ()
buildBinary rs bin context@Context {..} = do
binDeps <- if stage == Stage0 && package == ghcCabal
@@ -107,8 +106,6 @@ buildBinary rs bin context@Context {..} = do
cObjs <- mapM (objectPath context) cSrcs
hsObjs <- hsObjects context
return $ cObjs ++ hsObjs
- ++ [ path -/- "Paths_hsc2hs.o" | package == hsc2hs ]
- ++ [ path -/- "Paths_haddock.o" | package == haddock ]
need binDeps
buildWithResources rs $ target context (Ghc LinkHs stage) binDeps [bin]
synopsis <- traverse pkgSynopsis (pkgCabalFile package)