[GHC] #11102: `ghc --supported-extension` shall not list `TemplateHaskell` when unsupported

GHC ghc-devs at haskell.org
Tue Nov 17 13:16:33 UTC 2015


#11102: `ghc --supported-extension` shall not list `TemplateHaskell` when
unsupported
-------------------------------------+-------------------------------------
           Reporter:  hvr            |             Owner:  bgamari
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.0.1
          Component:  Compiler       |           Version:  7.10.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):  phab:D1484     |         Wiki Page:
-------------------------------------+-------------------------------------
 Currently GHC advertises `TemplateHaskell` even though it's statically
 known to fail:

 {{{
 $ ghc --supported-extensions | grep Template
 TemplateHaskell
 NoTemplateHaskell

 # `NoTemplateHaskell` works:
 $ ghc -XNoTemplateHaskell -c hello.hs

 # `TemplateHaskell` however fails even though advertised:
 $ ghc -XTemplateHaskell -c hello.hs
 ghc: on the commandline: Template Haskell requires GHC with interpreter
 support
     Perhaps you are using a stage-1 compiler?
 Usage: For basic information, try the `--help' option.
 }}}


 Having properly advertised extensions is particularly useful in
 combination with
 [[https://github.com/haskell/cabal/issues/2644|Cabal#2644]] allowing the
 solver to toggle flags depending on the availability of
 `-XTemplateHaskell`.

 For instance, cross-compilers and/or unregisterised GHC builds often
 don't have TemplateHaskell support. Having support for toggling flags
 based on availability of `-XTemplateHaskell` allows `cabal` to
 support such environments with less manual intervention.

 (See also https://github.com/haskell/cabal/pull/2930 for pre-GHC8
 emulation of this feature)

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11102>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list