[Git][ghc/ghc][master] hadrian: add a --freeze2 option to freeze stage 1 and 2

Marge Bot gitlab at gitlab.haskell.org
Thu May 14 00:03:47 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
d7e0b57f by Alp Mestanogullari at 2020-05-13T20:03:30-04:00
hadrian: add a --freeze2 option to freeze stage 1 and 2

- - - - -


3 changed files:

- hadrian/README.md
- hadrian/src/CommandLine.hs
- hadrian/src/Main.hs


Changes:

=====================================
hadrian/README.md
=====================================
@@ -101,6 +101,9 @@ time when you are working on a feature that affects both Stage1 and Stage2
 compilers, but may lead to incorrect build results. To unfreeze Stage1 GHC
 simply drop the `--freeze1` flag and Hadrian will rebuild all out-of-date files.
 
+* `--freeze2`: just like `--freeze1` but tell Hadrian to additionally freeze
+Stage2 GHC.
+
 * `--integer-simple`: build GHC using the `integer-simple` integer library
 (instead of `integer-gmp`).
 


=====================================
hadrian/src/CommandLine.hs
=====================================
@@ -1,6 +1,6 @@
 module CommandLine (
-    optDescrs, cmdLineArgsMap, cmdFlavour, lookupFreeze1, cmdIntegerSimple,
-    cmdProgressInfo, cmdConfigure, cmdCompleteSetting,
+    optDescrs, cmdLineArgsMap, cmdFlavour, lookupFreeze1, lookupFreeze2,
+    cmdIntegerSimple, cmdProgressInfo, cmdConfigure, cmdCompleteSetting,
     cmdDocsArgs, lookupBuildRoot, TestArgs(..), TestSpeed(..), defaultTestArgs
     ) where
 
@@ -24,6 +24,7 @@ data CommandLineArgs = CommandLineArgs
     { configure      :: Bool
     , flavour        :: Maybe String
     , freeze1        :: Bool
+    , freeze2        :: Bool
     , integerSimple  :: Bool
     , progressInfo   :: ProgressInfo
     , buildRoot      :: BuildRoot
@@ -38,6 +39,7 @@ defaultCommandLineArgs = CommandLineArgs
     { configure      = False
     , flavour        = Nothing
     , freeze1        = False
+    , freeze2        = False
     , integerSimple  = False
     , progressInfo   = Brief
     , buildRoot      = BuildRoot "_build"
@@ -100,8 +102,9 @@ readBuildRoot ms =
     set :: BuildRoot -> CommandLineArgs -> CommandLineArgs
     set flag flags = flags { buildRoot = flag }
 
-readFreeze1 :: Either String (CommandLineArgs -> CommandLineArgs)
+readFreeze1, readFreeze2 :: Either String (CommandLineArgs -> CommandLineArgs)
 readFreeze1 = Right $ \flags -> flags { freeze1 = True }
+readFreeze2 = Right $ \flags -> flags { freeze1 = True, freeze2 = True }
 
 readIntegerSimple :: Either String (CommandLineArgs -> CommandLineArgs)
 readIntegerSimple = Right $ \flags -> flags { integerSimple = True }
@@ -239,6 +242,8 @@ optDescrs =
       "Build flavour (Default, Devel1, Devel2, Perf, Prof, Quick or Quickest)."
     , Option [] ["freeze1"] (NoArg readFreeze1)
       "Freeze Stage1 GHC."
+    , Option [] ["freeze2"] (NoArg readFreeze2)
+      "Freeze Stage2 GHC."
     , Option [] ["integer-simple"] (NoArg readIntegerSimple)
       "Build GHC with integer-simple library."
     , Option [] ["progress-info"] (OptArg readProgressInfo "STYLE")
@@ -336,6 +341,9 @@ lookupBuildRoot = buildRoot . lookupExtra defaultCommandLineArgs
 lookupFreeze1 :: Map.HashMap TypeRep Dynamic -> Bool
 lookupFreeze1 = freeze1 . lookupExtra defaultCommandLineArgs
 
+lookupFreeze2 :: Map.HashMap TypeRep Dynamic -> Bool
+lookupFreeze2 = freeze2 . lookupExtra defaultCommandLineArgs
+
 cmdIntegerSimple :: Action Bool
 cmdIntegerSimple = integerSimple <$> cmdLineArgs
 


=====================================
hadrian/src/Main.hs
=====================================
@@ -30,7 +30,12 @@ main = do
         BuildRoot buildRoot = CommandLine.lookupBuildRoot argsMap
 
         rebuild = [ (RebuildLater, buildRoot -/- "stage0/**")
-                  | CommandLine.lookupFreeze1 argsMap ]
+                  | CommandLine.lookupFreeze1 argsMap ||
+                    CommandLine.lookupFreeze2 argsMap
+                  ] ++
+                  [ (RebuildLater, buildRoot -/- "stage1/**")
+                  | CommandLine.lookupFreeze2 argsMap
+                  ]
 
     cwd <- getCurrentDirectory
     shakeColor <- shouldUseColor



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d7e0b57fda289e2715e7be86d4871503e3c09ee8

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d7e0b57fda289e2715e7be86d4871503e3c09ee8
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200513/bd5efc31/attachment-0001.html>


More information about the ghc-commits mailing list