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

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:23:44 UTC 2017


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

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

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

commit 9233793b86b2b14efa3ae1adb5f95f378bf15ef8
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Wed Oct 5 17:35:44 2016 +0100

    Minor revision


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

9233793b86b2b14efa3ae1adb5f95f378bf15ef8
 src/Rules/Selftest.hs        | 2 +-
 src/Settings/Builders/Ghc.hs | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/Rules/Selftest.hs b/src/Rules/Selftest.hs
index 3b20f14..e7f5dbb 100644
--- a/src/Rules/Selftest.hs
+++ b/src/Rules/Selftest.hs
@@ -35,7 +35,7 @@ testBuilder :: Action ()
 testBuilder = do
     putBuild $ "==== trackedArgument"
     test $ forAll (elements ["-j", "MAKEFLAGS=-j", "THREADS="])
-         $ \prefix -> \(NonNegative n) ->
+         $ \prefix (NonNegative n) ->
             trackedArgument (Make undefined) prefix == False &&
             trackedArgument (Make undefined) ("-j" ++ show (n :: Int)) == False
 
diff --git a/src/Settings/Builders/Ghc.hs b/src/Settings/Builders/Ghc.hs
index 6eaf8ae..7f54af9 100644
--- a/src/Settings/Builders/Ghc.hs
+++ b/src/Settings/Builders/Ghc.hs
@@ -36,15 +36,13 @@ ghcLinkArgs :: Args
 ghcLinkArgs = builder (Ghc LinkHs) ? do
     stage   <- getStage
     libs    <- getPkgDataList DepExtraLibs
+    libDirs <- getPkgDataList DepLibDirs
     gmpLibs <- if stage > Stage0
                then do -- TODO: get this data more gracefully
+                   let strip = fromMaybe "" . stripPrefix "extra-libraries: "
                    buildInfo <- lift $ readFileLines gmpBuildInfoPath
-                   let extract s = case stripPrefix "extra-libraries: " s of
-                           Nothing    -> []
-                           Just value -> words value
-                   return $ concatMap extract buildInfo
+                   return $ concatMap (words . strip) buildInfo
                else return []
-    libDirs <- getPkgDataList DepLibDirs
     mconcat [ arg "-no-auto-link-packages"
             , append [ "-optl-l" ++           lib | lib <- libs ++ gmpLibs ]
             , append [ "-optl-L" ++ unifyPath dir | dir <- libDirs ] ]



More information about the ghc-commits mailing list