[commit: ghc] wip/nfs-locking: Move copyRules to Rules/Generate.hs, add missing generated dependencies. (03b3379)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:30:51 UTC 2017


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

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

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

commit 03b33797d88b27291c6a05f6141fac18be30efc4
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Thu Jan 7 17:02:35 2016 +0000

    Move copyRules to Rules/Generate.hs, add missing generated dependencies.


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

03b33797d88b27291c6a05f6141fac18be30efc4
 shaking-up-ghc.cabal  |  1 -
 src/Main.hs           |  3 +--
 src/Rules.hs          |  2 +-
 src/Rules/Copy.hs     | 20 --------------------
 src/Rules/Generate.hs | 18 ++++++++++++++++--
 5 files changed, 18 insertions(+), 26 deletions(-)

diff --git a/shaking-up-ghc.cabal b/shaking-up-ghc.cabal
index c680b85..9f2c80c 100644
--- a/shaking-up-ghc.cabal
+++ b/shaking-up-ghc.cabal
@@ -39,7 +39,6 @@ executable ghc-shake
                        , Rules.Cabal
                        , Rules.Compile
                        , Rules.Config
-                       , Rules.Copy
                        , Rules.Data
                        , Rules.Dependencies
                        , Rules.Documentation
diff --git a/src/Main.hs b/src/Main.hs
index 043e173..07f14ea 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -3,7 +3,6 @@ import Rules
 import Rules.Cabal
 import Rules.Config
 import Rules.Generate
-import Rules.Copy
 import Rules.Libffi
 import Rules.IntegerGmp
 import Rules.Oracles
@@ -12,7 +11,7 @@ main :: IO ()
 main = shakeArgs options $ do
     cabalRules      -- see Rules.Cabal
     configRules     -- see Rules.Config
-    copyRules       -- see Rules.Copy
+    copyRules       -- see Rules.Generate
     generateTargets -- see Rules
     generateRules   -- see Rules.Generate
     libffiRules     -- see Rules.Libffi
diff --git a/src/Rules.hs b/src/Rules.hs
index 9933225..22c5230 100644
--- a/src/Rules.hs
+++ b/src/Rules.hs
@@ -3,7 +3,7 @@ module Rules (generateTargets, packageRules) where
 import Base
 import Expression
 import GHC
-import Rules.Copy
+import Rules.Generate
 import Rules.Package
 import Rules.Resources
 import Settings
diff --git a/src/Rules/Copy.hs b/src/Rules/Copy.hs
deleted file mode 100644
index 7454fd9..0000000
--- a/src/Rules/Copy.hs
+++ /dev/null
@@ -1,20 +0,0 @@
-module Rules.Copy (installTargets, copyRules) where
-
-import Base
-import Expression
-import GHC
-import Rules.Actions
-import Rules.Generate
-
-installTargets :: [FilePath]
-installTargets = [ "inplace/lib/template-hsc.h"
-                 , "inplace/lib/platformConstants"
-                 , "inplace/lib/settings" ]
-
-copyRules :: Rules ()
-copyRules = do
-    "inplace/lib/template-hsc.h"    <~ pkgPath hsc2hs
-    "inplace/lib/platformConstants" <~ derivedConstantsPath
-    "inplace/lib/settings"          <~ "."
-  where
-    file <~ dir = file %> \_ -> copyFile (dir -/- takeFileName file) file
diff --git a/src/Rules/Generate.hs b/src/Rules/Generate.hs
index 8ca7b94..71d88b1 100644
--- a/src/Rules/Generate.hs
+++ b/src/Rules/Generate.hs
@@ -1,6 +1,7 @@
 module Rules.Generate (
     generatePackageCode, generateRules,
-    derivedConstantsPath, generatedDependencies
+    derivedConstantsPath, generatedDependencies,
+    installTargets, copyRules
     ) where
 
 import Base
@@ -20,6 +21,11 @@ import Rules.Resources (Resources)
 import Settings
 import Settings.Builders.DeriveConstants
 
+installTargets :: [FilePath]
+installTargets = [ "inplace/lib/template-hsc.h"
+                 , "inplace/lib/platformConstants"
+                 , "inplace/lib/settings" ]
+
 primopsSource :: FilePath
 primopsSource = "compiler/prelude/primops.txt.pp"
 
@@ -45,7 +51,7 @@ ghcPrimDependencies stage = ((targetPath stage ghcPrim -/- "build") -/-) <$>
        , "autogen/GHC/Prim.hs" ]
 
 derivedConstantsDependencies :: [FilePath]
-derivedConstantsDependencies = (derivedConstantsPath -/-) <$>
+derivedConstantsDependencies = installTargets ++ fmap (derivedConstantsPath -/-)
     [ "DerivedConstants.h"
     , "GHCConstantsHaskellType.hs"
     , "GHCConstantsHaskellWrappers.hs"
@@ -150,6 +156,14 @@ generatePackageCode _ target @ (PartialTarget stage pkg) =
                 copyFileChanged (pkgPath pkg -/- "runghc.hs") file
                 putSuccess $ "| Successfully generated '" ++ file ++ "'."
 
+copyRules :: Rules ()
+copyRules = do
+    "inplace/lib/template-hsc.h"    <~ pkgPath hsc2hs
+    "inplace/lib/platformConstants" <~ derivedConstantsPath
+    "inplace/lib/settings"          <~ "."
+  where
+    file <~ dir = file %> \_ -> copyFile (dir -/- takeFileName file) file
+
 generateRules :: Rules ()
 generateRules = do
     "includes/ghcautoconf.h" <~ generateGhcAutoconfH



More information about the ghc-commits mailing list