hadrian: Add `validate` and `slow validate` flavours
authorBen Gamari <ben@smart-cactus.org>
Fri, 26 Jul 2019 20:49:36 +0000 (16:49 -0400)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Tue, 8 Oct 2019 09:11:03 +0000 (05:11 -0400)
hadrian/doc/flavours.md
hadrian/hadrian.cabal
hadrian/src/Settings.hs
hadrian/src/Settings/Flavours/Validate.hs [new file with mode: 0644]

index 689c3f1..26d5115 100644 (file)
@@ -120,6 +120,28 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH
     <td></td>
     <td>-O0<br>-DDEBUG</td>
   </tr>
+  <tr>
+    <th>validate</td>
+    <td>-O0<br>-H64m</td>
+    <td>-fllvm-fill-undef-with-garbage</td>
+    <td></td>
+    <td>-O<br>-dcore-lint<br>-dno-debug-output</td>
+    <td>-O2<br>-DDEBUG</td>
+    <td>-O<br>-dcore-lint<br>-dno-debug-output</td>
+    <td>-O</td>
+    <td>-O</td>
+  </tr>
+  <tr>
+    <th>validate</td>
+    <td>-O0<br>-H64m</td>
+    <td>-fllvm-fill-undef-with-garbage</td>
+    <td></td>
+    <td>-O<br>-dcore-lint<br>-dno-debug-output</td>
+    <td>-O2<br>-DDEBUG</td>
+    <td>-O<br>-DDEBUG<br>-dcore-lint<br>-dno-debug-output</td>
+    <td>-O</td>
+    <td>-O</td>
+  </tr>
 </table>
 
 ### LLVM variants
index ce44a18..818114a 100644 (file)
@@ -101,6 +101,7 @@ executable hadrian
                        , Settings.Flavours.QuickCross
                        , Settings.Flavours.Quickest
                        , Settings.Flavours.GhcInGhci
+                       , Settings.Flavours.Validate
                        , Settings.Packages
                        , Settings.Parser
                        , Settings.Program
index ba0cff7..2263f68 100755 (executable)
@@ -21,6 +21,7 @@ import Settings.Flavours.Quick
 import Settings.Flavours.Quickest
 import Settings.Flavours.QuickCross
 import Settings.Flavours.GhcInGhci
+import Settings.Flavours.Validate
 
 import Control.Monad.Except
 import Data.Either
@@ -45,7 +46,7 @@ hadrianFlavours =
     , developmentFlavour Stage2, performanceFlavour, profiledFlavour
     , quickFlavour, quickestFlavour, quickCrossFlavour, benchmarkLlvmFlavour
     , performanceLlvmFlavour, profiledLlvmFlavour, quickLlvmFlavour
-    , ghcInGhciFlavour ]
+    , ghcInGhciFlavour, validateFlavour, slowValidateFlavour ]
 
 -- | This action looks up a flavour with the name given on the
 --   command line with @--flavour@, defaulting to 'userDefaultFlavour'
diff --git a/hadrian/src/Settings/Flavours/Validate.hs b/hadrian/src/Settings/Flavours/Validate.hs
new file mode 100644 (file)
index 0000000..f49f511
--- /dev/null
@@ -0,0 +1,46 @@
+module Settings.Flavours.Validate (validateFlavour, slowValidateFlavour) where
+
+import Expression
+import Flavour
+import Oracles.Flag
+import {-# SOURCE #-} Settings.Default
+
+-- Please update doc/flavours.md when changing this file.
+validateFlavour :: Flavour
+validateFlavour = werror $ defaultFlavour
+    { name = "validate"
+    , args = defaultBuilderArgs <> validateArgs <> defaultPackageArgs
+    , libraryWays = mconcat [ pure [vanilla]
+                            , notStage0 ? platformSupportsSharedLibs ? pure [dynamic]
+                            ]
+    , rtsWays = mconcat [ pure [vanilla, threaded, debug, logging, threadedDebug, threadedLogging]
+                        , notStage0 ? platformSupportsSharedLibs ? pure
+                            [ dynamic, threadedDynamic, debugDynamic, threadedDebugDynamic
+                            , loggingDynamic, threadedLoggingDynamic
+                            ]
+                        ]
+    }
+
+validateArgs :: Args
+validateArgs = sourceArgs SourceArgs
+    { hsDefault  = mconcat [ stage0 ? pure ["-O0", "-H64m"]
+                             -- See #11487
+                           , notStage0 ? arg "-fllvm-fill-undef-with-garbage"
+                           ]
+    , hsLibrary  = pure ["-O", "-dcore-lint", "-dno-debug-output"]
+    , hsCompiler = mconcat [ stage0 ? pure ["-O2", "-DDEBUG"]
+                           , notStage0 ? pure ["-O", "-dcore-lint", "-dno-debug-output"]
+                           ]
+    , hsGhc      = pure ["-O"] }
+
+slowValidateFlavour :: Flavour
+slowValidateFlavour = werror $ validateFlavour
+    { name = "slow-validate"
+    , args = defaultBuilderArgs <> slowValidateArgs <> defaultPackageArgs
+    }
+
+slowValidateArgs :: Args
+slowValidateArgs =
+  mconcat [ validateArgs
+          , notStage0 ? arg "-DDEBUG"
+          ]