diff options
-rw-r--r-- | hadrian/hadrian.cabal | 15 | ||||
-rw-r--r-- | hadrian/src/Main.hs | 6 |
2 files changed, 18 insertions, 3 deletions
diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal index da0aa4daab..c37974914a 100644 --- a/hadrian/hadrian.cabal +++ b/hadrian/hadrian.cabal @@ -24,6 +24,14 @@ flag threaded which don't support the threaded runtime should disable this flag. +-- See also #21913 +flag selftest + manual: True + default: True + description: Enables the hadrian selftest rules which require + QuickCheck. Disabling it thus saves on a few dependencies + which can be problematic when bootstrapping. + executable hadrian main-is: Main.hs hs-source-dirs: . @@ -82,7 +90,6 @@ executable hadrian , Rules.Program , Rules.Register , Rules.Rts - , Rules.Selftest , Rules.SimpleTargets , Rules.SourceDist , Rules.Test @@ -141,7 +148,6 @@ executable hadrian other-extensions: MultiParamTypeClasses , TypeFamilies build-depends: Cabal >= 3.2 && < 3.7 - , QuickCheck >= 2.6 && < 2.15 , base >= 4.8 && < 5 , bytestring >= 0.10 && < 0.12 , containers >= 0.5 && < 0.7 @@ -169,3 +175,8 @@ executable hadrian -- time tends to eat any benefit. "-with-rtsopts=-I0 -qg" -threaded + + if flag(selftest) + other-modules: Rules.Selftest + cpp-options: -DHADRIAN_ENABLE_SELFTEST + build-depends: QuickCheck >= 2.6 && < 2.15 diff --git a/hadrian/src/Main.hs b/hadrian/src/Main.hs index d2e0ace795..4c3dfe2bcc 100644 --- a/hadrian/src/Main.hs +++ b/hadrian/src/Main.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} module Main (main) where import Development.Shake @@ -19,7 +20,9 @@ import qualified Rules.Docspec import qualified Rules.Documentation import qualified Rules.Lint import qualified Rules.Nofib +#if HADRIAN_ENABLE_SELFTEST import qualified Rules.Selftest +#endif import qualified Rules.SourceDist import qualified Rules.Test import qualified UserSettings @@ -99,7 +102,9 @@ main = do Rules.Lint.lintRules Rules.Nofib.nofibRules Rules.oracleRules +#if HADRIAN_ENABLE_SELFTEST Rules.Selftest.selftestRules +#endif Rules.SourceDist.sourceDistRules Rules.Test.testRules Rules.topLevelTargets @@ -150,4 +155,3 @@ escNormal = "\ESC[0m" escape :: String -> String -> String escape code x = escForeground code ++ x ++ escNormal - |