[commit: ghc] wip/nfs-locking: Add buildPackageCompile rule. (c826054)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:20:02 UTC 2017


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

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

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

commit c826054081b67e094002e47e7635c7d34835f380
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Jan 11 03:31:07 2015 +0000

    Add buildPackageCompile rule.


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

c826054081b67e094002e47e7635c7d34835f380
 src/Package.hs              |  5 ++++-
 src/Package/Data.hs         |  2 +-
 src/Package/Dependencies.hs | 28 +---------------------------
 3 files changed, 6 insertions(+), 29 deletions(-)

diff --git a/src/Package.hs b/src/Package.hs
index 0df8668..8f2850d 100644
--- a/src/Package.hs
+++ b/src/Package.hs
@@ -2,6 +2,7 @@ module Package (packageRules) where
 
 import Package.Base
 import Package.Data
+import Package.Compile
 import Package.Dependencies
 
 -- See Package.Base for definitions of basic types
@@ -15,11 +16,13 @@ buildPackage :: Package -> TodoItem -> Rules ()
 buildPackage pkg todoItem = do
     buildPackageData         pkg todoItem
     buildPackageDependencies pkg todoItem
+    buildPackageCompile      pkg todoItem
 
 packageRules :: Rules ()
 packageRules = do
     -- TODO: control targets from commang line arguments
-    want ["libraries/deepseq/dist-install/build/deepseq.m"]
+    want [ "libraries/deepseq/dist-install/build/Control/DeepSeq.o"
+         , "libraries/deepseq/dist-install/build/Control/DeepSeq.p_o" ]
     forM_ packages $ \pkg -> do
         forM_ (pkgTodo pkg) $ \todoItem -> do
             buildPackage pkg todoItem
diff --git a/src/Package/Data.hs b/src/Package/Data.hs
index fd8dd2c..919d7a5 100644
--- a/src/Package/Data.hs
+++ b/src/Package/Data.hs
@@ -38,7 +38,7 @@ configureArgs stage settings =
     <> argConf "--with-cc" Gcc
 
 buildPackageData :: Package -> TodoItem -> Rules ()
-buildPackageData pkg @ (Package name path _) (stage, dist, settings) =
+buildPackageData (Package name path _) (stage, dist, settings) =
     let buildDir = path </> dist
         cabalArgs = arg ["configure", path, dist]
             -- this is a positional argument, hence:
diff --git a/src/Package/Dependencies.hs b/src/Package/Dependencies.hs
index 5b10ca1..26b154f 100644
--- a/src/Package/Dependencies.hs
+++ b/src/Package/Dependencies.hs
@@ -3,34 +3,8 @@ module Package.Dependencies (buildPackageDependencies) where
 
 import Package.Base
 
-packageArgs :: Stage -> FilePath -> Args
-packageArgs stage pkgData = do
-    usePackageKey <- SupportsPackageKey || stage /= Stage0
-    arg ["-hide-all-packages", "-no-user-package-db", "-include-pkg-deps"]
-        <> when (stage == Stage0) (arg "-package-db libraries/bootstrapping.conf")
-        <> keyArgs usePackageKey
-  where
-    keyArgs True  = prefixArgs "-this-package-key" (PackageKey pkgData) <>
-                    prefixArgs "-package-key"      (DepKeys    pkgData)
-    keyArgs False = prefixArgs "-package-name"     (PackageKey pkgData) <>
-                    prefixArgs "-package"          (Deps       pkgData)
-
-includeArgs :: ShowArgs a => String -> FilePath -> a -> Args
-includeArgs prefix path as = map includePath <$> arg as
-  where
-    includePath dir | isRelative dir = prefix ++ path </> dir
-                    | isAbsolute dir = prefix         </> dir
-
-srcArgs :: FilePath -> FilePath -> Args
-srcArgs path pkgData = do
-    mods <- map (replaceEq '.' pathSeparator) <$> arg (Modules pkgData)
-    dirs <- arg (SrcDirs pkgData)
-    srcs <- getDirectoryFiles ""
-        [path </> dir </> mPath <.> ext | dir <- dirs, mPath <- mods, ext <- ["hs", "lhs"]]
-    arg (map normalise srcs)
-
 buildPackageDependencies :: Package -> TodoItem -> Rules ()
-buildPackageDependencies pkg @ (Package name path _) (stage, dist, settings) =
+buildPackageDependencies (Package name path _) (stage, dist, settings) =
     let buildDir = path </> dist
         pkgData  = buildDir </> "package-data.mk"
     in



More information about the ghc-commits mailing list