Commit 1b562e3c authored by Oleg Grenrus's avatar Oleg Grenrus Committed by GitHub

Merge pull request #6947 from phadej/ghc-8.12-features

Ghc 8.12 features
parents 44cfe7d1 a89d9851
......@@ -137,7 +137,7 @@ configure verbosity hcPath hcPkgPath conf0 = do
let implInfo = ghcVersionImplInfo ghcVersion
-- Cabal currently supports ghc >= 7.0.1 && < 8.12
unless (ghcVersion < mkVersion [8,12]) $
unless (ghcVersion < mkVersion [8,14]) $
warn verbosity $
"Unknown/unsupported 'ghc' version detected "
++ "(Cabal " ++ prettyShow cabalVersion ++ " supports 'ghc' version < 8.12): "
......
......@@ -55,7 +55,7 @@ normaliseGhcArgs (Just ghcVersion) PackageDescription{..} ghcArgs
supportedGHCVersions :: VersionRange
supportedGHCVersions = intersectVersionRanges
(orLaterVersion (mkVersion [8,0]))
(earlierVersion (mkVersion [8,11]))
(earlierVersion (mkVersion [8,13]))
from :: Monoid m => [Int] -> m -> m
from version flags
......@@ -237,6 +237,7 @@ normaliseGhcArgs (Just ghcVersion) PackageDescription{..} ghcArgs
, from [8,4] $ to [8,6] [ "-fno-max-valid-substitutions" ]
, from [8,6] [ "-dhex-word-literals" ]
, from [8,8] [ "-fshow-docs-of-hole-fits", "-fno-show-docs-of-hole-fits" ]
, from [8,12] [ "-dlinear-core-lint" ]
]
isOptIntFlag :: String -> Any
......
......@@ -840,6 +840,15 @@ data KnownExtension =
-- | Enable unlifted newtypes.
| UnliftedNewtypes
-- | Use whitespace to determine whether the minus sign stands for negation or subtraction.
| LexicalNegation
-- | Enable qualified do-notation desugaring.
| QualifiedDo
-- | Enable linear types.
| LinearTypes
deriving (Generic, Show, Read, Eq, Ord, Enum, Bounded, Typeable, Data)
instance Binary KnownExtension
......
......@@ -19,6 +19,7 @@ tests = testGroup "Distribution.Simple.Program.GHC"
options_8_8_all
assertListEquals flags options_8_8_affects
, testCase "options added in GHC-8.10" $ do
let flags :: [String]
flags = normaliseGhcArgs
......@@ -27,6 +28,15 @@ tests = testGroup "Distribution.Simple.Program.GHC"
options_8_10_all
assertListEquals flags options_8_10_affects
, testCase "options added in GHC-8.12" $ do
let flags :: [String]
flags = normaliseGhcArgs
(Just $ mkVersion [8,12,1])
emptyPackageDescription
options_8_12_all
assertListEquals flags options_8_12_affects
]
]
......@@ -140,3 +150,23 @@ options_8_10_affects =
, "-include-cpp-deps"
, "-optcxx"
]
-------------------------------------------------------------------------------
-- GHC-8.12
-------------------------------------------------------------------------------
options_8_12_all :: [String]
options_8_12_all =
[ "-ddump-cmm-opt"
, "-ddump-cpranal"
, "-ddump-cpr-signatures"
, "-ddump-hie"
-- NOTE: we filter out -dlinear-core-lint
-- we filter, -dcore-lint, -dstg-lint etc.
, "-dlinear-core-lint"
] ++ options_8_12_affects
options_8_12_affects :: [String]
options_8_12_affects =
[ "-fcmm-static-pred"
]
......@@ -24,7 +24,7 @@ tests = testGroup "Distribution.Utils.Structured"
, testCase "SPDX.License" $ structureHash (Proxy :: Proxy License) @?= md5FromInteger 0xd3d4a09f517f9f75bc3d16370d5a853a
-- The difference is in encoding of newtypes
#if MIN_VERSION_base(4,7,0)
, testCase "GenericPackageDescription" $ structureHash (Proxy :: Proxy GenericPackageDescription) @?= md5FromInteger 0xc3fd68379b7d09c2e3f751d10dde4fd6
, testCase "LocalBuildInfo" $ structureHash (Proxy :: Proxy LocalBuildInfo) @?= md5FromInteger 0x54cdbbfa6df9a9fb2c6d792d1d77d672
, testCase "GenericPackageDescription" $ structureHash (Proxy :: Proxy GenericPackageDescription) @?= md5FromInteger 0x2f869c09d0cd2288d55b0455830e5a61
, testCase "LocalBuildInfo" $ structureHash (Proxy :: Proxy LocalBuildInfo) @?= md5FromInteger 0x2d64c99467083bef4a894162a121c467
#endif
]
......@@ -1113,6 +1113,7 @@ planPackages verbosity comp platform solver SolverSettings{..}
-- TODO: long-term, this compatibility matrix should be
-- stored as a field inside 'Distribution.Compiler.Compiler'
setupMinCabalVersionConstraint
| isGHC, compVer >= mkVersion [8,12] = mkVersion [3,4]
| isGHC, compVer >= mkVersion [8,10] = mkVersion [3,2]
| isGHC, compVer >= mkVersion [8,8] = mkVersion [3,0]
| isGHC, compVer >= mkVersion [8,6] = mkVersion [2,4]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment