[commit: ghc] wip/andrey/cached-hadrian: Drop GhcPkg Init, which is no longer used. (0ba321e)

git at git.haskell.org git at git.haskell.org
Fri Feb 8 17:49:44 UTC 2019


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

On branch  : wip/andrey/cached-hadrian
Link       : http://ghc.haskell.org/trac/ghc/changeset/0ba321efc0729018bb4dfcfd5afaa806675ccff1/ghc

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

commit 0ba321efc0729018bb4dfcfd5afaa806675ccff1
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Fri Feb 8 13:15:58 2019 +0000

    Drop GhcPkg Init, which is no longer used.
    
    Part of https://gitlab.haskell.org/ghc/ghc/merge_requests/317.


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

0ba321efc0729018bb4dfcfd5afaa806675ccff1
 hadrian/src/Builder.hs                  | 10 +++++-----
 hadrian/src/Rules/Gmp.hs                | 10 ++++++----
 hadrian/src/Settings/Builders/GhcPkg.hs |  3 +--
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/hadrian/src/Builder.hs b/hadrian/src/Builder.hs
index 3d50adc..02edb19 100644
--- a/hadrian/src/Builder.hs
+++ b/hadrian/src/Builder.hs
@@ -75,13 +75,13 @@ instance Hashable ConfigurationInfo
 instance NFData   ConfigurationInfo
 
 -- TODO: Do we really need all these modes? Why do we need 'Dependencies'? We
--- can extract dependencies using the Cabal library.
+-- can extract dependencies using the Cabal library. Note: we used to also have
+-- the @Init@ mode for initialising a new package database but we've deleted it.
 -- | 'GhcPkg' can initialise a package database and register packages in it.
-data GhcPkgMode = Init         -- ^ Initialize a new database.
-                | Update       -- ^ Update a package.
-                | Copy         -- ^ Copy a package from one database to another.
-                | Unregister   -- ^ Unregister a package.
+data GhcPkgMode = Copy         -- ^ Copy a package from one database to another.
                 | Dependencies -- ^ Compute package dependencies.
+                | Unregister   -- ^ Unregister a package.
+                | Update       -- ^ Update a package.
                 deriving (Eq, Generic, Show)
 
 instance Binary   GhcPkgMode
diff --git a/hadrian/src/Rules/Gmp.hs b/hadrian/src/Rules/Gmp.hs
index 93e675b..9b56a3e 100644
--- a/hadrian/src/Rules/Gmp.hs
+++ b/hadrian/src/Rules/Gmp.hs
@@ -39,7 +39,7 @@ gmpContext = vanillaContext Stage1 integerGmp
 gmpBuildPath :: Action FilePath
 gmpBuildPath = buildRoot <&> (-/- stageString (stage gmpContext) -/- "gmp")
 
--- | As 'gmpBuildPath' but in the 'Rules' monad.
+-- | Like 'gmpBuildPath' but in the 'Rules' monad.
 gmpBuildPathRules :: Rules FilePath
 gmpBuildPathRules = buildRootRules <&> (-/- stageString (stage gmpContext) -/- "gmp")
 
@@ -59,7 +59,6 @@ configureEnvironment = sequence [ builderEnvironment "CC" $ Cc CompileC Stage1
 gmpRules :: Rules ()
 gmpRules = do
     -- Copy appropriate GMP header and object files
-    root    <- buildRootRules
     gmpPath <- gmpBuildPathRules
     gmpPath -/- gmpLibraryH %> \header -> do
         windows  <- windowsHost
@@ -86,8 +85,11 @@ gmpRules = do
         build $ target gmpContext (Make gmpPath) [gmpPath -/- "Makefile"] [lib]
         putSuccess "| Successfully built custom library 'gmp'"
 
-    gmpPath -/- gmpLibraryInTreeH %>                copyFile (gmpPath -/- gmpLibraryH)
-    root -/- buildDir gmpContext -/- gmpLibraryH %> copyFile (gmpPath -/- gmpLibraryH)
+    gmpPath -/- gmpLibraryInTreeH %> copyFile (gmpPath -/- gmpLibraryH)
+
+    root <- buildRootRules
+    root -/- buildDir gmpContext -/- gmpLibraryH %>
+        copyFile (gmpPath -/- gmpLibraryH)
 
     -- This file is created when 'integerGmp' is configured.
     gmpPath -/- "config.mk" %> \_ -> do
diff --git a/hadrian/src/Settings/Builders/GhcPkg.hs b/hadrian/src/Settings/Builders/GhcPkg.hs
index c9a5353..9223a9d 100644
--- a/hadrian/src/Settings/Builders/GhcPkg.hs
+++ b/hadrian/src/Settings/Builders/GhcPkg.hs
@@ -4,8 +4,7 @@ import Settings.Builders.Common
 
 ghcPkgBuilderArgs :: Args
 ghcPkgBuilderArgs = mconcat
-    [ builder (GhcPkg Init) ? mconcat [ arg "init", arg =<< getOutput ] -- TODO: unused?
-    , builder (GhcPkg Copy) ? do
+    [ builder (GhcPkg Copy) ? do
         verbosity <- expr getVerbosity
         stage     <- getStage
         pkgDb     <- expr $ packageDbPath stage



More information about the ghc-commits mailing list