summaryrefslogtreecommitdiff
path: root/hadrian/src/CommandLine.hs
diff options
context:
space:
mode:
Diffstat (limited to 'hadrian/src/CommandLine.hs')
-rw-r--r--hadrian/src/CommandLine.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/hadrian/src/CommandLine.hs b/hadrian/src/CommandLine.hs
index 6fc74af5d3..9de13ef89e 100644
--- a/hadrian/src/CommandLine.hs
+++ b/hadrian/src/CommandLine.hs
@@ -1,7 +1,7 @@
module CommandLine (
optDescrs, cmdLineArgsMap, cmdFlavour, lookupFreeze1, lookupFreeze2, lookupSkipDepends,
cmdBignum, cmdBignumCheck, cmdProgressInfo, cmdCompleteSetting,
- cmdDocsArgs, lookupBuildRoot, TestArgs(..), TestSpeed(..), defaultTestArgs,
+ cmdDocsArgs, cmdUnitIdHash, lookupBuildRoot, TestArgs(..), TestSpeed(..), defaultTestArgs,
cmdPrefix, DocArgs(..), defaultDocArgs
) where
@@ -28,6 +28,7 @@ data CommandLineArgs = CommandLineArgs
, freeze1 :: Bool
, freeze2 :: Bool
, skipDepends :: Bool
+ , unitIdHash :: Bool
, bignum :: Maybe String
, bignumCheck :: Bool
, progressInfo :: ProgressInfo
@@ -47,6 +48,7 @@ defaultCommandLineArgs = CommandLineArgs
, freeze1 = False
, freeze2 = False
, skipDepends = False
+ , unitIdHash = False
, bignum = Nothing
, bignumCheck = False
, progressInfo = Brief
@@ -136,6 +138,9 @@ readFreeze1 = Right $ \flags -> flags { freeze1 = True }
readFreeze2 = Right $ \flags -> flags { freeze1 = True, freeze2 = True }
readSkipDepends = Right $ \flags -> flags { skipDepends = True }
+readUnitIdHash :: Either String (CommandLineArgs -> CommandLineArgs)
+readUnitIdHash = Right $ \flags -> flags { unitIdHash = True }
+
readProgressInfo :: String -> Either String (CommandLineArgs -> CommandLineArgs)
readProgressInfo ms =
case lower ms of
@@ -269,6 +274,8 @@ optDescrs =
"Freeze Stage1 GHC."
, Option [] ["freeze2"] (NoArg readFreeze2)
"Freeze Stage2 GHC."
+ , Option [] ["hash-unit-ids"] (NoArg readUnitIdHash)
+ "Include package hashes in unit ids."
, Option [] ["skip-depends"] (NoArg readSkipDepends)
"Skip rebuilding dependency information."
, Option [] ["bignum"] (OptArg readBignum "BACKEND")
@@ -380,6 +387,9 @@ lookupFreeze2 = freeze2 . lookupExtra defaultCommandLineArgs
lookupSkipDepends :: Map.HashMap TypeRep Dynamic -> Bool
lookupSkipDepends = skipDepends . lookupExtra defaultCommandLineArgs
+cmdUnitIdHash :: Action Bool
+cmdUnitIdHash = unitIdHash <$> cmdLineArgs
+
cmdBignum :: Action (Maybe String)
cmdBignum = bignum <$> cmdLineArgs