summaryrefslogtreecommitdiff
path: root/hadrian/src/Hadrian
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2021-03-05 19:13:39 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-09 02:46:20 -0500
commit0a709dd9876e40c19c934692415c437ac434318c (patch)
tree0ac02b3eb1d1397cf0bfa495c84b0ff2e8834bde /hadrian/src/Hadrian
parentbfa862503a9f8b2e8a61b9499d2cc3be789779fd (diff)
downloadhaskell-0a709dd9876e40c19c934692415c437ac434318c.tar.gz
Require GHC 8.10 as the minimum compiler for bootstrapping
Now that GHC 9.0.1 is released, it is time to drop support for bootstrapping with GHC 8.8, as we only support building with the previous two major GHC releases. As an added bonus, this allows us to remove several bits of CPP that are either always true or no longer reachable.
Diffstat (limited to 'hadrian/src/Hadrian')
-rw-r--r--hadrian/src/Hadrian/Haskell/Cabal/Parse.hs14
1 files changed, 2 insertions, 12 deletions
diff --git a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
index 776edb15e7..49352c6823 100644
--- a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
+++ b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
@@ -38,9 +38,7 @@ import qualified Distribution.Simple.PackageIndex as C
import qualified Distribution.Text as C
import qualified Distribution.Types.LocalBuildInfo as C
import qualified Distribution.Types.MungedPackageId as C
-#if MIN_VERSION_Cabal(3,2,0)
import qualified Distribution.Utils.ShortText as C
-#endif
#if !MIN_VERSION_Cabal(3,4,0)
import qualified Distribution.Types.CondTree as C
#endif
@@ -76,8 +74,8 @@ parsePackageData pkg = do
deps = nubOrd sorted \\ [name]
depPkgs = catMaybes $ map findPackageByName deps
return $ PackageData name version
- (shortTextToString (C.synopsis pd))
- (shortTextToString (C.description pd))
+ (C.fromShortText (C.synopsis pd))
+ (C.fromShortText (C.description pd))
depPkgs gpd
where
-- Collect an overapproximation of dependencies by ignoring conditionals
@@ -87,14 +85,6 @@ parsePackageData pkg = do
where
f (C.CondBranch _ t mt) = collectDeps (Just t) ++ collectDeps mt
-#if MIN_VERSION_Cabal(3,2,0)
- shortTextToString :: C.ShortText -> String
- shortTextToString = C.fromShortText
-#else
- shortTextToString :: String -> String
- shortTextToString = id
-#endif
-
-- | Parse the package identifier from a Cabal file.
parseCabalPkgId :: FilePath -> IO String
parseCabalPkgId file = C.display . C.package . C.packageDescription <$> C.readGenericPackageDescription C.silent file