Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 2 additions & 14 deletions Cabal-tests/exes/GhcSupportedExtensions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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."
]
Expand Down
Loading