[commit: ghc] wip/nfs-locking: Fix missing options and pkgDepObjects. (92352f7)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:22:42 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/92352f7763115e6a78452b48d9872681a4dca3eb/ghc

>---------------------------------------------------------------

commit 92352f7763115e6a78452b48d9872681a4dca3eb
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Jan 13 07:29:56 2015 +0000

    Fix missing options and pkgDepObjects.


>---------------------------------------------------------------

92352f7763115e6a78452b48d9872681a4dca3eb
 src/Package/Base.hs         | 7 ++++---
 src/Package/Compile.hs      | 3 ++-
 src/Package/Dependencies.hs | 1 +
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/Package/Base.hs b/src/Package/Base.hs
index f6c70ea..bac6801 100644
--- a/src/Package/Base.hs
+++ b/src/Package/Base.hs
@@ -122,9 +122,10 @@ pkgDepObjects :: FilePath -> FilePath -> Way -> Action [FilePath]
 pkgDepObjects path dist way = do
     let pkgData  = path </> dist </> "package-data.mk"
         buildDir = path </> dist </> "build"
-        hs2obj   = (buildDir ++) . drop (length path) . (-<.> osuf way)
-    srcs <- pkgHsSources path dist
-    return $ map (toStandard . hs2obj) srcs
+    dirs <- map (normaliseEx . (path </>)) <$> arg (SrcDirs pkgData)
+    fmap concat $ forM dirs $ \d -> 
+        map (toStandard . (buildDir ++) . (-<.> osuf way) . drop (length d))
+        <$> (findModuleFiles pkgData [d] [".hs", ".lhs"])
 
 -- Find objects that go to library
 pkgLibObjects :: FilePath -> FilePath -> Stage -> Way -> Action [FilePath]
diff --git a/src/Package/Compile.hs b/src/Package/Compile.hs
index 80835f8..c42d592 100644
--- a/src/Package/Compile.hs
+++ b/src/Package/Compile.hs
@@ -48,6 +48,7 @@ oRule (Package name path _) (stage, dist, settings) =
             <> arg SrcHcOpts
             <> packageArgs stage pkgData
             <> includeArgs path dist
+            <> concatArgs ["-optP"] (CppOpts pkgData) 
             -- TODO: now we have both -O and -O2
             <> arg ["-Wall", "-XHaskell2010", "-O2"]
             <> productArgs ["-odir", "-hidir", "-stubdir"] buildDir
@@ -55,7 +56,7 @@ oRule (Package name path _) (stage, dist, settings) =
             <> arg ("-c":srcs)
             <> arg ["-o", toStandard out]
 
--- TODO: This rule looks a bit of a hack... combine it with the above?
+-- TODO: This rule looks hacky... combine it with the above?
 hiRule :: Package -> TodoItem -> Rules ()
 hiRule (Package name path _) (stage, dist, settings) =
     let buildDir = path </> dist </> "build"
diff --git a/src/Package/Dependencies.hs b/src/Package/Dependencies.hs
index 63ed508..fc9f4af 100644
--- a/src/Package/Dependencies.hs
+++ b/src/Package/Dependencies.hs
@@ -13,6 +13,7 @@ buildPackageDependencies (Package name path _) (stage, dist, settings) =
         terseRun (Ghc stage) $ arg "-M"
             <> packageArgs stage pkgData
             <> includeArgs path dist
+            <> concatArgs ["-optP"] (CppOpts pkgData) 
             <> productArgs ["-odir", "-stubdir", "-hidir"] buildDir
             <> arg ["-dep-makefile", toStandard $ out <.> "new"]
             <> productArgs "-dep-suffix" (map wayPrefix <$> ways settings)



More information about the ghc-commits mailing list