[commit: ghc] wip/nfs-locking: Minor revision (599381f)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 01:20:43 UTC 2017


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

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

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

commit 599381f0fda1ea8fbae64b748b7b09727189f53b
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Wed Jul 19 16:03:35 2017 +0100

    Minor revision


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

599381f0fda1ea8fbae64b748b7b09727189f53b
 src/Oracles/Config/Setting.hs | 20 ++++++++++----------
 src/Rules/Install.hs          |  9 +++++----
 src/Settings/Path.hs          | 12 ++++++------
 3 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/src/Oracles/Config/Setting.hs b/src/Oracles/Config/Setting.hs
index c4ed10e..1bf9186 100644
--- a/src/Oracles/Config/Setting.hs
+++ b/src/Oracles/Config/Setting.hs
@@ -53,19 +53,18 @@ data Setting = BuildArch
              | IconvIncludeDir
              | IconvLibDir
              | CursesLibDir
-             -- Paths to where GHC is installed
-             -- ref: mk/install.mk
+             -- Paths to where GHC is installed (ref: mk/install.mk)
              | InstallPrefix
              | InstallBinDir
              | InstallLibDir
              | InstallDataRootDir
-             -- "install" utility
+             -- Command lines for invoking the @install@ utility
              | Install
              | InstallData
              | InstallProgram
              | InstallScript
              | InstallDir
-             -- symbolic link
+             -- Command line for creating a symbolic link
              | LnS
 
 data SettingList = ConfCcArgs Stage
@@ -202,9 +201,10 @@ cmdLineLengthLimit = do
         -- On all other systems, we try this:
         _             -> 4194304 -- Cabal library needs a bit more than 2MB!
 
--- | On Windows we normally want to make a relocatable bindist,
--- to we ignore flags like libdir
--- ref: mk/config.mk.in:232
+-- ref: https://ghc.haskell.org/trac/ghc/wiki/Building/Installing#HowGHCfindsitsfiles
+-- | On Windows we normally build a relocatable installation, which assumes that
+-- the library directory @libdir@ is in a fixed location relative to the GHC
+-- binary, namely @../lib at .
 relocatableBuild :: Action Bool
 relocatableBuild = windowsHost
 
@@ -213,10 +213,10 @@ installDocDir = do
   version <- setting ProjectVersion
   (-/- ("doc/ghc-" ++ version)) <$> setting InstallDataRootDir
 
--- | Unix: override libdir and datadir to put ghc-specific stuff in
--- a subdirectory with the version number included.
 -- ref: mk/install.mk:101
 -- TODO: CroosCompilePrefix
+-- | Unix: override @libdir@ and @datadir@ to put GHC-specific files in a
+-- subdirectory with the version number included.
 installGhcLibDir :: Action String
 installGhcLibDir = do
   r <- relocatableBuild
@@ -224,4 +224,4 @@ installGhcLibDir = do
   if r then return libdir
        else do
          v <- setting ProjectVersion
-         return (libdir -/- ("ghc-" ++ v))
+         return $ libdir -/- ("ghc-" ++ v)
diff --git a/src/Rules/Install.hs b/src/Rules/Install.hs
index 525746b..77e340e 100644
--- a/src/Rules/Install.hs
+++ b/src/Rules/Install.hs
@@ -128,6 +128,7 @@ withLatestBuildStage pkg m = do
       Nothing    -> return ()
 
 -- ref: rules/manual-package-conf.mk
+-- TODO: Should we use a temporary file instead of pkgConfInstallPath?
 -- | Install @package.conf.install@ for each package. Note that it will be
 -- recreated each time.
 installPackageConf :: Action ()
@@ -161,7 +162,7 @@ installPackages = do
     -- Install RTS
     let rtsDir = destDir ++ ghcLibDir -/- "rts"
     installDirectory rtsDir
-    ways <- interpretInContext (vanillaContext Stage1 rts) getRtsWays
+    ways    <- interpretInContext (vanillaContext Stage1 rts) getRtsWays
     rtsLibs <- mapM pkgLibraryFile $ map (Context Stage1 rts) ways
     ffiLibs <- sequence $ map rtsLibffiLibrary ways
 
@@ -183,14 +184,14 @@ installPackages = do
         when (isLibrary pkg) $
             withLatestBuildStage pkg $ \stage -> do
                 let context = vanillaContext stage pkg
-                top <- interpretInContext context getTopDirectory
+                top <- topDirectory
                 let installDistDir = top -/- buildPath context
                 buildPackage stage pkg
                 docDir <- installDocDir
                 ghclibDir <- installGhcLibDir
 
                 -- Copy over packages
-                strip <- stripCmdPath context
+                strip <- stripCmdPath
                 ways  <- interpretInContext context getLibraryWays
                 let ghcCabalInplace = inplaceBinPath -/- "ghc-cabal" <.> exe -- HACK?
                 need [ghcCabalInplace]
@@ -230,7 +231,7 @@ installPackages = do
         when (isLibrary pkg) $
             withLatestBuildStage pkg $ \stage -> do
                 let context = vanillaContext stage pkg
-                top <- interpretInContext context getTopDirectory
+                top <- topDirectory
                 let installDistDir = top -/- buildPath context
                 -- TODO: better reference to the built inplace binary path
                 let ghcCabalInplace = inplaceBinPath -/- "ghc-cabal"
diff --git a/src/Settings/Path.hs b/src/Settings/Path.hs
index 1b0dc13..0be1838 100644
--- a/src/Settings/Path.hs
+++ b/src/Settings/Path.hs
@@ -14,8 +14,8 @@ import Context
 import Expression
 import GHC
 import Oracles.PackageData
-import Oracles.Config.Setting (setting, Setting(..))
-import Oracles.Path (getTopDirectory)
+import Oracles.Config.Setting
+import Oracles.Path
 import UserSettings
 
 -- | Path to the directory containing the Shake database and other auxiliary
@@ -202,12 +202,12 @@ inplaceInstallPath pkg
 ghcSplitPath :: FilePath
 ghcSplitPath = inplaceLibBinPath -/- "ghc-split"
 
--- | Command line tool for stripping
 -- ref: mk/config.mk
-stripCmdPath :: Context -> Action FilePath
-stripCmdPath ctx = do
+-- | Command line tool for stripping.
+stripCmdPath :: Action FilePath
+stripCmdPath = do
     targetPlatform <- setting TargetPlatform
-    top <- interpretInContext ctx getTopDirectory
+    top <- topDirectory
     case targetPlatform of
         "x86_64-unknown-mingw32" ->
              return (top -/- "inplace/mingw/bin/strip.exe")



More information about the ghc-commits mailing list