[commit: ghc] : Fix regression incorrectly advertising TH support (bdc9680)

git at git.haskell.org git at git.haskell.org
Wed Mar 6 16:38:15 UTC 2019


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

On branch  : 
Link       : http://ghc.haskell.org/trac/ghc/changeset/bdc9680cc5fe36f09b263d886e8b4e99d5c84635/ghc

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

commit bdc9680cc5fe36f09b263d886e8b4e99d5c84635
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
    
    (cherry picked from commit db4372cda7f6c87e7ad26efe3fca4b3f7f527a48)


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

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

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 95a7122..5391326 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -4084,6 +4084,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