[commit: ghc] wip/T13633, wip/non-det-ci: Fix regression incorrectly advertising TH support (ee284b8)

git at git.haskell.org git at git.haskell.org
Sun Feb 24 20:54:55 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branches: wip/T13633,wip/non-det-ci
Link       : http://ghc.haskell.org/trac/ghc/changeset/ee284b854e514685036dc21a1ee61241c76d14b5/ghc

>---------------------------------------------------------------

commit ee284b854e514685036dc21a1ee61241c76d14b5
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Feb 16 22:08:46 2019 +0100

    Fix regression incorrectly advertising TH support
    
    `--supported-languages` must only advertise language extensions
    which are supported by the compiler in order for tooling such
    as Cabal relying on this signalling not to behave incorrectly.
    
    Fixes #16331


>---------------------------------------------------------------

ee284b854e514685036dc21a1ee61241c76d14b5
 compiler/main/DynFlags.hs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index f929d98..dca692e 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -4290,6 +4290,14 @@ supportedExtensions :: [String]
 supportedExtensions = concatMap toFlagSpecNamePair xFlags
   where
     toFlagSpecNamePair flg
+#if !defined(GHCI)
+      -- IMPORTANT! Make sure that `ghc --supported-extensions` omits
+      -- "TemplateHaskell"/"QuasiQuotes" when it's known not to work out of the
+      -- box. See also GHC #11102 and #16331 for more details about
+      -- the rationale
+      | flagSpecFlag flg == LangExt.TemplateHaskell  = [noName]
+      | flagSpecFlag flg == LangExt.QuasiQuotes      = [noName]
+#endif
       | otherwise = [name, noName]
       where
         noName = "No" ++ name



More information about the ghc-commits mailing list