[Git][ghc/ghc][wip/angerman/fix-int-gmp] 2 commits: hadrian: add flag to skip rebuilding dependency information #17636

Moritz Angermann gitlab at gitlab.haskell.org
Thu Jul 9 01:32:47 UTC 2020



Moritz Angermann pushed to branch wip/angerman/fix-int-gmp at Glasgow Haskell Compiler / GHC


Commits:
3033e0e4 by Adam Sandberg Ericsson at 2020-07-08T20:36:49-04:00
hadrian: add flag to skip rebuilding dependency information #17636

- - - - -
e5428393 by Moritz Angermann at 2020-07-08T21:32:44-04:00
fix gmp selection

- - - - -


5 changed files:

- hadrian/README.md
- hadrian/doc/make.md
- hadrian/src/CommandLine.hs
- hadrian/src/Main.hs
- libraries/ghc-bignum/gmp/ghc.mk


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


=====================================
libraries/ghc-bignum/gmp/ghc.mk
=====================================
@@ -77,11 +77,13 @@ endif
 endif
 
 UseIntreeGmp = NO
+ifeq "$(GMP_ENABLED)" "YES"
 ifneq "$(HaveLibGmp)" "YES"
 ifneq "$(HaveFrameworkGMP)" "YES"
 UseIntreeGmp = YES
 endif
 endif
+endif
 
 # gmp_wrappers.c includes "ghc-gmp.h"
 libraries/ghc-bignum/cbits/gmp_wrappers.c: libraries/ghc-bignum/include/ghc-gmp.h



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d4bc3c0eaf345a3ff020fa71ee97c6e8546a33a8...e54283931d4586e5001c8bb99ea90cdbc82e5746

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d4bc3c0eaf345a3ff020fa71ee97c6e8546a33a8...e54283931d4586e5001c8bb99ea90cdbc82e5746
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/c55e0384/attachment-0001.html>


More information about the ghc-commits mailing list