[Git][ghc/ghc][wip/marge_bot_batch_merge_job] hadrian: add flag to skip rebuilding dependency information #17636
Marge Bot
gitlab at gitlab.haskell.org
Wed Jul 8 18:46:10 UTC 2020
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
348f19c0 by Adam Sandberg Ericsson at 2020-07-08T14:46:07-04:00
hadrian: add flag to skip rebuilding dependency information #17636
- - - - -
4 changed files:
- hadrian/README.md
- hadrian/doc/make.md
- hadrian/src/CommandLine.hs
- hadrian/src/Main.hs
Changes:
=====================================
hadrian/README.md
=====================================
@@ -104,6 +104,8 @@ 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.
+* `--skip-depends`: skips rebuilding Haskell module dependency files.
+
* `--integer-simple`: build GHC using the `integer-simple` integer library
(instead of `integer-gmp`).
=====================================
hadrian/doc/make.md
=====================================
@@ -208,3 +208,17 @@ time you fire up a build. This is not possible with the Make build system.
# Hadrian
build nofib # builds the compiler and everything we need if necessary, too
```
+
+- `make FAST=YES`
+
+ Partially supported in hadrian with the `--skip-depends` argument. Since
+ hadrian is not directory aware some of the features of `FAST=YES` are not
+ replicated.
+
+ ```sh
+ # Make
+ make FAST=YES
+
+ # Hadrian
+ build --skip-depends
+ ```
=====================================
hadrian/src/CommandLine.hs
=====================================
@@ -1,5 +1,5 @@
module CommandLine (
- optDescrs, cmdLineArgsMap, cmdFlavour, lookupFreeze1, lookupFreeze2,
+ optDescrs, cmdLineArgsMap, cmdFlavour, lookupFreeze1, lookupFreeze2, lookupSkipDepends,
cmdBignum, cmdBignumCheck, cmdProgressInfo, cmdConfigure, cmdCompleteSetting,
cmdDocsArgs, lookupBuildRoot, TestArgs(..), TestSpeed(..), defaultTestArgs,
cmdPrefix
@@ -26,6 +26,7 @@ data CommandLineArgs = CommandLineArgs
, flavour :: Maybe String
, freeze1 :: Bool
, freeze2 :: Bool
+ , skipDepends :: Bool
, bignum :: Maybe String
, bignumCheck :: Bool
, progressInfo :: ProgressInfo
@@ -43,6 +44,7 @@ defaultCommandLineArgs = CommandLineArgs
, flavour = Nothing
, freeze1 = False
, freeze2 = False
+ , skipDepends = False
, bignum = Nothing
, bignumCheck = False
, progressInfo = Brief
@@ -114,9 +116,10 @@ readBuildRoot ms =
set :: BuildRoot -> CommandLineArgs -> CommandLineArgs
set flag flags = flags { buildRoot = flag }
-readFreeze1, readFreeze2 :: Either String (CommandLineArgs -> CommandLineArgs)
+readFreeze1, readFreeze2, readSkipDepends :: Either String (CommandLineArgs -> CommandLineArgs)
readFreeze1 = Right $ \flags -> flags { freeze1 = True }
readFreeze2 = Right $ \flags -> flags { freeze1 = True, freeze2 = True }
+readSkipDepends = Right $ \flags -> flags { skipDepends = True }
readProgressInfo :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs)
readProgressInfo ms =
@@ -256,6 +259,8 @@ optDescrs =
"Freeze Stage1 GHC."
, Option [] ["freeze2"] (NoArg readFreeze2)
"Freeze Stage2 GHC."
+ , Option [] ["skip-depends"] (NoArg readSkipDepends)
+ "Skip rebuilding dependency information."
, Option [] ["bignum"] (OptArg readBignum "BIGNUM")
"Select GHC BigNum backend: native, gmp, ffi."
, Option [] ["progress-info"] (OptArg readProgressInfo "STYLE")
@@ -361,6 +366,9 @@ lookupFreeze1 = freeze1 . lookupExtra defaultCommandLineArgs
lookupFreeze2 :: Map.HashMap TypeRep Dynamic -> Bool
lookupFreeze2 = freeze2 . lookupExtra defaultCommandLineArgs
+lookupSkipDepends :: Map.HashMap TypeRep Dynamic -> Bool
+lookupSkipDepends = skipDepends . lookupExtra defaultCommandLineArgs
+
cmdBignum :: Action (Maybe String)
cmdBignum = bignum <$> cmdLineArgs
=====================================
hadrian/src/Main.hs
=====================================
@@ -35,7 +35,10 @@ main = do
] ++
[ (RebuildLater, buildRoot -/- "stage1/**")
| CommandLine.lookupFreeze2 argsMap
- ]
+ ] ++
+ (if CommandLine.lookupSkipDepends argsMap
+ then [(RebuildLater, buildRoot -/- "**/.dependencies.mk"), (RebuildLater, buildRoot -/- "**/.dependencies")]
+ else [])
cwd <- getCurrentDirectory
shakeColor <- shouldUseColor
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/348f19c00d0f14112e3845b4654b8ab9cb694db9
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/348f19c00d0f14112e3845b4654b8ab9cb694db9
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/20200708/84c52e0b/attachment-0001.html>
More information about the ghc-commits
mailing list