diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 304a841017e..6b06b0a32b2 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -230,6 +230,9 @@ jobs: # one possibly nightmarish final conditional. 'fail-fast' gets us # partway there, at least, but is still imperfect. + - name: Check that language extensions are registered for this GHC version + run: cabal run ghc-supported-extensions ghc + validate-old-ghcs: name: Validate old ghcs ${{ matrix.extra-ghc }} # latest/latest doesn't have the old packages the old ghcs depend on diff --git a/Cabal-tests/exes/GhcSupportedExtensions.hs b/Cabal-tests/exes/GhcSupportedExtensions.hs index d7d203fcce1..f68d8409614 100644 --- a/Cabal-tests/exes/GhcSupportedExtensions.hs +++ b/Cabal-tests/exes/GhcSupportedExtensions.hs @@ -11,7 +11,6 @@ import Distribution.Text (display, simpleParse) import Distribution.Verbosity (Verbosity (..), defaultVerbosityHandles, normal) import Language.Haskell.Extension (Extension (..), knownLanguages) -import Data.List ((\\)) import System.Environment (getArgs, getProgName) -- | Language editions as Extensions. @@ -61,11 +60,8 @@ checkProblems implemented = -- Extensions that ghc knows about but that are not registered except for the known languages. let unregistered = [ext | ext <- implemented, not (registered ext), ext `notElem` langsAsExts] - -- check if someone has forgotten to update the `langsAsExts` exceptions list... - badExceptions = langsAsExts \\ implemented - -- exceptions that are now registered - badExceptions' = filter registered langsAsExts + badExceptions = filter registered langsAsExts in catMaybes [ check unregistered $ unlines @@ -75,19 +71,11 @@ checkProblems implemented = , "All extensions should be registered, even experimental extensions." ] , check badExceptions $ - unlines - [ "Error in the extension exception list. The following extensions" - , "are listed as exceptions but are not even implemented by GHC:" - , " " ++ intercalate "\n " (map display badExceptions) - , "Please fix this test program by correcting the list of" - , "exceptions." - ] - , check badExceptions' $ unlines [ "Error in the extension exception list. The following extensions" , "are listed as exceptions to registration but they are in fact" , "now registered in Language.Haskell.Extension:" - , " " ++ intercalate "\n " (map display badExceptions') + , " " ++ intercalate "\n " (map display badExceptions) , "Please fix this test program by correcting the list of" , "exceptions." ]