diff --git a/Cabal/src/Distribution/Simple/GHC.hs b/Cabal/src/Distribution/Simple/GHC.hs index d8e48adb425a8d5d691bade52bcadcc7b769b832..2ef352f300b0d6b0c5bf358033018d9c507a0b0a 100644 --- a/Cabal/src/Distribution/Simple/GHC.hs +++ b/Cabal/src/Distribution/Simple/GHC.hs @@ -185,10 +185,13 @@ configure verbosity hcPath hcPkgPath conf0 = do ghcInfo <- Internal.getGhcInfo verbosity implInfo ghcProg let ghcInfoMap = Map.fromList ghcInfo - extensions = -- workaround https://gitlab.haskell.org/ghc/ghc/-/issues/11214 - filterExt JavaScriptFFI $ - -- see 'filterExtTH' comment below - filterExtTH $ extensions0 + filterJS = if ghcVersion < mkVersion [9, 8] then filterExt JavaScriptFFI else id + extensions = + -- workaround https://gitlab.haskell.org/ghc/ghc/-/issues/11214 + filterJS $ + -- see 'filterExtTH' comment below + filterExtTH $ + extensions0 -- starting with GHC 8.0, `TemplateHaskell` will be omitted from -- `--supported-extensions` when it's not available.