[commit: ghc] wip/nfs-locking: Put RTS's package configuration into inplace-pkg-config for consistency (e3b5f08)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:45:41 UTC 2017


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

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

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

commit e3b5f08db5ea710b36a696e38f10263c955b86eb
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Nov 27 01:01:03 2016 +0000

    Put RTS's package configuration into inplace-pkg-config for consistency


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

e3b5f08db5ea710b36a696e38f10263c955b86eb
 src/Rules/Register.hs           | 4 ++--
 src/Settings/Builders/GhcPkg.hs | 3 +--
 src/Settings/Packages/Rts.hs    | 6 +-----
 src/Settings/Path.hs            | 6 +++++-
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/Rules/Register.hs b/src/Rules/Register.hs
index f912b20..b7e12d1 100644
--- a/src/Rules/Register.hs
+++ b/src/Rules/Register.hs
@@ -22,10 +22,10 @@ registerPackage rs context at Context {..} = when (stage <= Stage1) $ do
         -- This produces inplace-pkg-config. TODO: Add explicit tracking.
         need [pkgDataFile context]
 
-        -- Post-process inplace-pkg-config. TODO: remove, see #113, #148.
+        -- Post-process inplace-pkg-config.
         top <- topDirectory
         let path      = buildPath context
-            pkgConfig = path -/- "inplace-pkg-config"
+            pkgConfig = inplacePkgConfig context
             oldPath   = top -/- path </> "build"
 
         fixFile pkgConfig $ unlines . map (replace oldPath path) . lines
diff --git a/src/Settings/Builders/GhcPkg.hs b/src/Settings/Builders/GhcPkg.hs
index b17f36a..5156d71 100644
--- a/src/Settings/Builders/GhcPkg.hs
+++ b/src/Settings/Builders/GhcPkg.hs
@@ -13,10 +13,9 @@ initArgs = initPredicate ? mconcat [ arg "init", arg =<< getOutput ]
 
 updateArgs :: Args
 updateArgs = notM initPredicate ? do
-    path      <- getBuildPath
     verbosity <- lift $ getVerbosity
     mconcat [ arg "update"
             , arg "--force"
             , verbosity < Chatty ? arg "-v0"
             , bootPackageDatabaseArgs
-            , arg $ path -/- "inplace-pkg-config" ]
+            , arg . inplacePkgConfig =<< getContext ]
diff --git a/src/Settings/Packages/Rts.hs b/src/Settings/Packages/Rts.hs
index 4c3cc99..40b85e4 100644
--- a/src/Settings/Packages/Rts.hs
+++ b/src/Settings/Packages/Rts.hs
@@ -18,7 +18,7 @@ rtsConfIn :: FilePath
 rtsConfIn = pkgPath rts -/- "package.conf.in"
 
 rtsConf :: FilePath
-rtsConf = buildPath rtsContext -/- "package.conf.inplace"
+rtsConf = inplacePkgConfig rtsContext
 
 rtsLibffiLibraryName :: Action FilePath
 rtsLibffiLibraryName = do
@@ -96,10 +96,6 @@ rtsPackageArgs = package rts ? do
 
         , builder Ghc ? arg "-Irts"
 
-        , builder (GhcPkg Stage1) ? mconcat
-          [ remove [path -/- "inplace-pkg-config"]
-          , arg rtsConf ]
-
         , builder HsCpp ? append
           [ "-DTOP="             ++ show top
           , "-DFFI_INCLUDE_DIR=" ++ show ffiIncludeDir
diff --git a/src/Settings/Path.hs b/src/Settings/Path.hs
index 0a22077..cbe1612 100644
--- a/src/Settings/Path.hs
+++ b/src/Settings/Path.hs
@@ -4,7 +4,7 @@ module Settings.Path (
     gmpBuildInfoPath, generatedPath, libffiBuildPath, shakeFilesPath,
     pkgConfFile, packageDbDirectory, packageDbStamp, bootPackageConstraints,
     packageDependencies, objectPath, programInplacePath, programInplaceLibPath,
-    installPath, autogenPath
+    installPath, autogenPath, inplacePkgConfig
     ) where
 
 import Base
@@ -60,6 +60,10 @@ autogenPath context at Context {..}
   where
     autogen dir = buildPath context -/- dir -/- "autogen"
 
+-- | Path to inplace package configuration of a given 'Context'.
+inplacePkgConfig :: Context -> FilePath
+inplacePkgConfig context = buildPath context -/- "inplace-pkg-config"
+
 -- | Path to the @package-data.mk@ of a given 'Context'.
 pkgDataFile :: Context -> FilePath
 pkgDataFile context = buildPath context -/- "package-data.mk"



More information about the ghc-commits mailing list