[commit: ghc] wip/nfs-locking: Refactor paths to auxiliary build files. (4a90b33)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:53:39 UTC 2017


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

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

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

commit 4a90b33ef70df26624fc064cdd4508677a0b7eec
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sat Jan 16 18:08:51 2016 +0000

    Refactor paths to auxiliary build files.
    
    See #176.


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

4a90b33ef70df26624fc064cdd4508677a0b7eec
 src/Rules/Actions.hs                |  2 --
 src/Settings/Builders/Ghc.hs        |  4 ----
 src/Settings/Packages/IntegerGmp.hs |  6 +-----
 src/Settings/Paths.hs               | 16 ++++++++++++----
 4 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/src/Rules/Actions.hs b/src/Rules/Actions.hs
index 21d134f..663f53d 100644
--- a/src/Rules/Actions.hs
+++ b/src/Rules/Actions.hs
@@ -157,13 +157,11 @@ putInfo Target.Target {..} = putProgressInfo $ renderAction
     digest [x] = x
     digest (x:xs) = x ++ " (and " ++ show (length xs) ++ " more)"
 
-
 -- | Switch for @putBuild@ filtered through @buildInfo@
 putProgressInfo :: String -> Action ()
 putProgressInfo s | buildInfo /= None = putBuild s
 putProgressInfo _                     = pure ()
 
-
 -- | Render an action.
 renderAction :: String -> String -> String -> String
 renderAction what input output = case buildInfo of
diff --git a/src/Settings/Builders/Ghc.hs b/src/Settings/Builders/Ghc.hs
index 0f1fc32..c97cd56 100644
--- a/src/Settings/Builders/Ghc.hs
+++ b/src/Settings/Builders/Ghc.hs
@@ -11,10 +11,6 @@ import Settings
 import Settings.Builders.GhcCabal (bootPackageDbArgs)
 import Settings.Builders.Common (cIncludeArgs)
 
--- GMP library names extracted from integer-gmp.buildinfo
-gmpLibNameCache :: FilePath
-gmpLibNameCache = shakeFilesPath -/- "gmp-lib-names"
-
 -- TODO: add support for -dyno
 -- $1/$2/build/%.$$($3_o-bootsuf) : $1/$4/%.hs-boot
 --     $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
diff --git a/src/Settings/Packages/IntegerGmp.hs b/src/Settings/Packages/IntegerGmp.hs
index 8b100b3..7122457 100644
--- a/src/Settings/Packages/IntegerGmp.hs
+++ b/src/Settings/Packages/IntegerGmp.hs
@@ -4,11 +4,7 @@ import Base
 import Expression
 import GHC (integerGmp)
 import Predicates (builder, builderGcc, package)
-import Settings.User
-
--- TODO: move elsewhere
-gmpBuildPath :: FilePath
-gmpBuildPath = buildRootPath -/- "stage0/gmp"
+import Settings.Paths
 
 -- TODO: move build artefacts to buildRootPath, see #113
 -- TODO: Is this needed?
diff --git a/src/Settings/Paths.hs b/src/Settings/Paths.hs
index bec143b..0513d6c 100644
--- a/src/Settings/Paths.hs
+++ b/src/Settings/Paths.hs
@@ -1,6 +1,7 @@
 module Settings.Paths (
     targetDirectory, targetPath, pkgDataFile, pkgHaddockFile, pkgLibraryFile,
-    pkgGhciLibraryFile, packageConfiguration, packageConfigurationInitialised
+    pkgGhciLibraryFile, packageConfiguration, packageConfigurationInitialised,
+    gmpBuildPath, gmpLibNameCache
     ) where
 
 import Base
@@ -47,6 +48,13 @@ packageConfiguration _      = "inplace/lib/package.conf.d"
 
 -- StageN, N > 0, share the same packageConfiguration (see above)
 packageConfigurationInitialised :: Stage -> FilePath
-packageConfigurationInitialised stage =
-    shakeFilesPath -/- "package-configuration-initialised-"
-    ++ stageString (min stage Stage1)
+packageConfigurationInitialised stage = packageConfiguration stage -/-
+    "package-configuration-initialised-" ++ stageString (min stage Stage1)
+
+-- This is the build directory for in-tree GMP library
+gmpBuildPath :: FilePath
+gmpBuildPath = buildRootPath -/- "stage0/gmp"
+
+-- GMP library names extracted from integer-gmp.buildinfo
+gmpLibNameCache :: FilePath
+gmpLibNameCache = gmpBuildPath -/- "gmp-lib-names"



More information about the ghc-commits mailing list