[GHC] #11102: `ghc --supported-extension` shall not list `TemplateHaskell` when unsupported
#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
#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 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): phab:D1484 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Herbert Valerio Riedel <hvr@…>): In [changeset:"7c9cbfd9074055d6db93d4b44c8aea8d32402aa6/ghc" 7c9cbfd/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="7c9cbfd9074055d6db93d4b44c8aea8d32402aa6" template-haskell: drop `TemplateHaskell` requirement `other-extensions: TemplateHaskell` is inaccurate: It's not required to compile `template-haskell` (otherwise we wouldn't be able to build that package via `ghc-stage1`...) This has been discovered while working on #11102 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11102#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): phab:D1484 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Herbert Valerio Riedel <hvr@…>): In [changeset:"98a4fa5fb740ce43a1787eb5730e35b463a2de79/ghc" 98a4fa5/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="98a4fa5fb740ce43a1787eb5730e35b463a2de79" DynFlags: Don't list TemplateHaskell as supported if it's not `-XTemplateHaskell` requires GHCi; don't show it in `--supported-extensions` if it's not supported. Together with https://github.com/haskell/cabal/issues/2644 this allows to finally fix a long-standing annoyance in cabal of not being able to detect availability of TH in build-plans. Fixes #11102 See also https://github.com/haskell/cabal/pull/2930 which provides emulation of this feature for older GHCs. Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D1484 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11102#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): phab:D1484 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"85fcd035f73679927a0539d5f6c9b919517365e1/ghc" 85fcd035/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="85fcd035f73679927a0539d5f6c9b919517365e1" Implement new -XTemplateHaskellQuotes pragma Since f16ddcee0c64a92ab911a7841a8cf64e3ac671fd / D876, `ghc-stage1` supports a subset of `-XTemplateHaskell`, but since we need Cabal to be able detect (so `.cabal` files can be specified accordingly, see also GHC #11102 which omits `TemplateHaskell` from `--supported-extensions`) whether GHC provides full or only partial `-XTemplateHaskell` support, the proper way to accomplish this is to split off the quotation/non-splicing `TemplateHaskell` feature-subset into a new language pragma `TemplateHaskellQuotes`. Moreover, `-XTemplateHaskellQuotes` is considered safe under SafeHaskell This addresses #11121 Reviewers: goldfire, ezyang, dterei, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1511 GHC Trac Issues: #11121 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11102#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11102: `ghc --supported-extension` shall not list `TemplateHaskell` when unsupported -------------------------------------+------------------------------------- Reporter: hvr | Owner: bgamari Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): phab:D1484 Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11102#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC