summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Sandberg Ericsson <adam@sandbergericsson.se>2020-07-04 16:40:51 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-08 20:36:49 -0400
commit3033e0e4940e6ecc43f478f1dcfbd0c3cb1e3ef8 (patch)
tree69e03c48671842d3f025e40fd1cddcfb120e1570
parent204f3f5ddec56403bfb12e74291b3b1d14824138 (diff)
downloadhaskell-3033e0e4940e6ecc43f478f1dcfbd0c3cb1e3ef8.tar.gz
hadrian: add flag to skip rebuilding dependency information #17636
-rw-r--r--hadrian/README.md2
-rw-r--r--hadrian/doc/make.md14
-rw-r--r--hadrian/src/CommandLine.hs12
-rw-r--r--hadrian/src/Main.hs5
4 files changed, 30 insertions, 3 deletions
diff --git a/hadrian/README.md b/hadrian/README.md
index 6a9346b997..d0ab7a274d 100644
--- a/hadrian/README.md
+++ b/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`).
diff --git a/hadrian/doc/make.md b/hadrian/doc/make.md
index 318b736fa5..b047baed1d 100644
--- a/hadrian/doc/make.md
+++ b/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
+ ```
diff --git a/hadrian/src/CommandLine.hs b/hadrian/src/CommandLine.hs
index 4582a8b258..080c4a2f6c 100644
--- a/hadrian/src/CommandLine.hs
+++ b/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
diff --git a/hadrian/src/Main.hs b/hadrian/src/Main.hs
index 632b742624..bc04c707d8 100644
--- a/hadrian/src/Main.hs
+++ b/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