[commit: ghc] wip/nfs-locking: Add bootPackageDb function. (2990db6)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:07:48 UTC 2017


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

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

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

commit 2990db6fa1688f58c252787320a14e800658e6f8
Author: Andrey Mokhov <andrey.mokhov at ncl.ac.uk>
Date:   Fri Jan 16 18:19:12 2015 +0000

    Add bootPackageDb function.


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

2990db6fa1688f58c252787320a14e800658e6f8
 src/Base.hs         |  1 +
 src/Package/Data.hs | 18 ++++++++++++------
 src/Targets.hs      | 22 ++++++++++++----------
 3 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/src/Base.hs b/src/Base.hs
index f4edb45..232bca2 100644
--- a/src/Base.hs
+++ b/src/Base.hs
@@ -65,6 +65,7 @@ instance ShowArgs a => ShowArgs [a] where
 instance ShowArgs a => ShowArgs (Action a) where
     showArgs = (showArgs =<<)
 
+-- TODO: improve args type safety
 args :: ShowArgs a => a -> Args
 args = showArgs
 
diff --git a/src/Package/Data.hs b/src/Package/Data.hs
index cfc8b53..b6c28c6 100644
--- a/src/Package/Data.hs
+++ b/src/Package/Data.hs
@@ -73,6 +73,12 @@ bootPkgConstraints = args $ do
             _             -> redError $ "Cannot determine package version in '"
                                       ++ toStandard cabal ++ "'."
 
+bootPackageDb :: Args
+bootPackageDb = do
+    top <- showArg GhcSourcePath
+    arg $ toStandard
+        $ "--package-db=" ++ top </> "libraries/bootstrapping.conf"
+
 cabalArgs :: Package -> TodoItem -> Args
 cabalArgs pkg @ (Package _ path _) todo @ (stage, dist, settings) = args
     [ args ["configure", path, dist]
@@ -83,6 +89,7 @@ cabalArgs pkg @ (Package _ path _) todo @ (stage, dist, settings) = args
     , with (Ghc stage) -- TODO: used limited to max stage1 GHC
     , with (GhcPkg stage)
     , customConfArgs settings
+    , when (stage == Stage0) bootPackageDb
     , libraryArgs =<< ways settings
     , when (specified HsColour) $ with HsColour
     , configureArgs stage settings
@@ -94,12 +101,11 @@ cabalArgs pkg @ (Package _ path _) todo @ (stage, dist, settings) = args
     , with Happy ] -- TODO: reorder with's
 
 ghcPkgArgs :: Package -> TodoItem -> Args
-ghcPkgArgs (Package _ path _) (stage, dist, _) = return $
-    [ "update"
-    , "--force"
-    , toStandard $ path </> dist </> "inplace-pkg-config" ]
-    ++
-    [ "--package-db=libraries/bootstrapping.conf" | stage == Stage0 ]
+ghcPkgArgs (Package _ path _) (stage, dist, _) = args $
+    [ arg "update"
+    , arg "--force"
+    , arg $ toStandard $ path </> dist </> "inplace-pkg-config"
+    , when (stage == Stage0) bootPackageDb ]
 
 buildRule :: Package -> TodoItem -> Rules ()
 buildRule pkg @ (Package name path _) todo @ (stage, dist, settings) =
diff --git a/src/Targets.hs b/src/Targets.hs
index 59fdbf1..3895bae 100644
--- a/src/Targets.hs
+++ b/src/Targets.hs
@@ -12,16 +12,18 @@ libraryPackagesInStage Stage0 =
     , "hoopl"
     , "hpc"
     , "transformers" ]
-libraryPackagesInStage Stage1 = []
-    --[ "array"
-    --, "deepseq"
-    --, "Cabal/Cabal"
-    --, "containers"
-    --, "filepath"
-    --, "parallel"
-    --, "pretty"
-    --, "stm"
-    --, "template-haskell" ]
+libraryPackagesInStage Stage1 =
+    libraryPackagesInStage Stage0 ++
+    [ "array"
+    , "deepseq"
+    , "Cabal/Cabal"
+    , "containers"
+    , "filepath"
+    , "parallel"
+    , "pretty"
+    , "stm"
+    , "template-haskell" ]
+
 libraryPackagesInStage _ = []
 
 libraryPackages :: [String]



More information about the ghc-commits mailing list