Skip to content

Conditionally omit TemplateHaskell from set of supported extensions #2930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2015

Conversation

hvr
Copy link
Member

@hvr hvr commented Nov 17, 2015

This emulates what GHC>=8 will do on its own for older GHC versions.

This is particularly useful in combination with #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.

This emulates what GHC>=8 will do on its own for older GHC versions.

This is particularly useful in combination with haskell#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.
@hvr
Copy link
Member Author

hvr commented Nov 17, 2015

See also https://phabricator.haskell.org/D1484

/cc @bgamari

@phadej
Copy link
Collaborator

phadej commented Nov 17, 2015

Would be nice to have a package test for that...

@23Skidoo
Copy link
Member

LGTM.

@phadej
Coming up with a test for this may be hard because you need a non-standard GHC.

23Skidoo added a commit that referenced this pull request Nov 17, 2015
Conditionally omit `TemplateHaskell` from set of supported extensions
@23Skidoo 23Skidoo merged commit 4aa16b2 into haskell:master Nov 17, 2015
@phadej
Copy link
Collaborator

phadej commented Nov 17, 2015

@23Skidoo Ah indeed. Pity. Have to live without test then.

hvr pushed a commit to ghc/ghc that referenced this pull request Nov 18, 2015
`-XTemplateHaskell` requires GHCi; don't show it in
`--supported-extensions` if it's not supported.

Together with haskell/cabal#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 haskell/cabal#2930 which provides
emulation of this feature for older GHCs.

Reviewed By: bgamari

Differential Revision: https://phabricator.haskell.org/D1484
@hvr hvr deleted the pr/filter-th-ext branch March 3, 2016 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants