Skip to content

Commit c3fcc3e

Browse files
authored
Drop support for GHC 9.0 (#3875)
* fix dodgy macro * Automatically remove macros for 9.2 * Manual GLASGOW_HASKELL bits * Remove from CI * Remove from docs * Remove from release CI * fix positions * Some simplification in ghcide * Maybe fix * Maybe this * WIP * More
1 parent 2764d04 commit c3fcc3e

File tree

48 files changed

+94
-1702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+94
-1702
lines changed

.github/workflows/release.yaml

+4-13
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
ghc: ["9.8.1", "9.6.3", "9.4.7", "9.2.8", "9.0.2"]
33+
ghc: ["9.8.1", "9.6.3", "9.4.7", "9.2.8"]
3434
platform: [ { image: "debian:9"
3535
, installCmd: "sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list && sed -i 's|security.debian.org|archive.debian.org/|g' /etc/apt/sources.list && sed -i /-updates/d /etc/apt/sources.list && apt-get update && apt-get install -y"
3636
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
@@ -118,15 +118,6 @@ jobs:
118118
# Perhaps we can migrate *all* unknown linux builds to a uniform
119119
# image.
120120
include:
121-
- ghc: 9.0.2
122-
platform:
123-
{ image: "rockylinux:8"
124-
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
125-
, toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
126-
, DISTRO: "Unknown"
127-
, ARTIFACT: "x86_64-linux-unknown"
128-
, ADD_CABAL_ARGS: "--enable-split-sections"
129-
}
130121
- ghc: 9.2.8
131122
platform:
132123
{ image: "rockylinux:8"
@@ -222,7 +213,7 @@ jobs:
222213
strategy:
223214
fail-fast: true
224215
matrix:
225-
ghc: ["9.8.1", "9.6.3", "9.4.7", "9.2.8", "9.0.2"]
216+
ghc: ["9.8.1", "9.6.3", "9.4.7", "9.2.8" ]
226217
steps:
227218
- uses: docker://arm64v8/ubuntu:focal
228219
name: Cleanup (aarch64 linux)
@@ -282,7 +273,7 @@ jobs:
282273
strategy:
283274
fail-fast: false
284275
matrix:
285-
ghc: ["9.8.1", "9.6.3", "9.4.7", "9.2.8", "9.0.2"]
276+
ghc: ["9.8.1", "9.6.3", "9.4.7", "9.2.8"]
286277
steps:
287278
- name: Checkout code
288279
uses: actions/checkout@v3
@@ -372,7 +363,7 @@ jobs:
372363
strategy:
373364
fail-fast: false
374365
matrix:
375-
ghc: ["9.8.1", "9.6.3", "9.4.7", "9.2.8", "9.0.2"]
366+
ghc: ["9.8.1", "9.6.3", "9.4.7", "9.2.8"]
376367
steps:
377368
- name: install windows deps
378369
shell: pwsh
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[ "9.8", "9.6", "9.4" , "9.2" , "9.0" ]
1+
[ "9.8", "9.6", "9.4" , "9.2" ]

docs/support/ghc-version-support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Support status (see the support policy below for more details):
3232
| 9.2.(5,6) | [1.9.1.0](https://github.com/haskell/haskell-language-server/releases/tag/1.9.1.0) | deprecated |
3333
| 9.2.(3,4) | [1.8.0.0](https://github.com/haskell/haskell-language-server/releases/tag/1.8.0.0) | deprecated |
3434
| 9.2.(1,2) | [1.7.0.0](https://github.com/haskell/haskell-language-server/releases/tag/1.7.0.0) | deprecated |
35-
| 9.0.2 | [latest](https://github.com/haskell/haskell-language-server/releases/latest) | full support |
35+
| 9.0.2 | [2.4.0.0](https://github.com/haskell/haskell-language-server/releases/tag/2.4.0.0) | deprecated |
3636
| 9.0.1 | [1.6.1.0](https://github.com/haskell/haskell-language-server/releases/tag/1.6.1.0) | deprecated |
3737
| 8.10.7 | [2.2.0.0](https://github.com/haskell/haskell-language-server/releases/tag/2.2.0.0) | deprecated |
3838
| 8.10.6 | [1.6.1.0](https://github.com/haskell/haskell-language-server/releases/tag/1.6.1.0) | deprecated |

docs/support/plugin-support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ For example, a plugin to provide a formatter which has itself been abandoned has
6060
| `hls-ormolu-plugin` | 2 | 9.8 |
6161
| `hls-rename-plugin` | 2 | 9.8 |
6262
| `hls-stylish-haskell-plugin` | 2 | 9.8 |
63-
| `hls-overloaded-record-dot-plugin` | 2 | 9.0 |
63+
| `hls-overloaded-record-dot-plugin` | 2 | |
6464
| `hls-floskell-plugin` | 3 | 9.6, 9.8 |
6565
| `hls-stan-plugin` | 3 | 9.2.(4-8) |
6666
| `hls-retrie-plugin` | 3 | 9.8 |

ghcide/ghcide.cabal

-10
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ source-repository head
2828
type: git
2929
location: https://github.com/haskell/haskell-language-server.git
3030

31-
flag ghc-patched-unboxed-bytecode
32-
description:
33-
The GHC version we link against supports unboxed sums and tuples in bytecode
34-
35-
default: False
36-
manual: True
37-
3831
flag ekg
3932
description:
4033
Enable EKG monitoring of the build graph and other metrics on port 8999
@@ -232,9 +225,6 @@ library
232225
-Wall -Wincomplete-uni-patterns -Wno-unticked-promoted-constructors
233226
-Wunused-packages -fno-ignore-asserts
234227

235-
if flag(ghc-patched-unboxed-bytecode)
236-
cpp-options: -DGHC_PATCHED_UNBOXED_BYTECODE
237-
238228
if flag(pedantic)
239229
-- We eventually want to build with Werror fully, but we haven't
240230
-- finished purging the warnings, so some are set to not be errors

ghcide/session-loader/Development/IDE/Session.hs

+2-5
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ import Data.Function
4040
import Data.Hashable hiding (hash)
4141
import qualified Data.HashMap.Strict as HM
4242
import Data.List
43+
import Data.List.NonEmpty (NonEmpty (..))
4344
import qualified Data.List.NonEmpty as NE
44-
import Data.List.NonEmpty (NonEmpty(..))
4545
import qualified Data.Map.Strict as Map
4646
import Data.Maybe
4747
import Data.Proxy
@@ -826,7 +826,7 @@ newComponentCache recorder exts cradlePath cfp hsc_env uids ci = do
826826
#if MIN_VERSION_ghc(9,3,0)
827827
-- Set up a multi component session with the other units on GHC 9.4
828828
Compat.initUnits (map snd uids) (hscSetFlags df hsc_env)
829-
#elif MIN_VERSION_ghc(9,2,0)
829+
#else
830830
-- This initializes the units for GHC 9.2
831831
-- Add the options for the current component to the HscEnv
832832
-- We want to call `setSessionDynFlags` instead of `hscSetFlags`
@@ -837,9 +837,6 @@ newComponentCache recorder exts cradlePath cfp hsc_env uids ci = do
837837
evalGhcEnv hsc_env $ do
838838
_ <- setSessionDynFlags $ df
839839
getSession
840-
#else
841-
-- getOptions is enough to initialize units on GHC <9.2
842-
pure $ hscSetFlags df hsc_env { hsc_IC = (hsc_IC hsc_env) { ic_dflags = df } }
843840
#endif
844841

845842
let newFunc = maybe newHscEnvEqPreserveImportPaths newHscEnvEq cradlePath

ghcide/src/Development/IDE/Core/Compile.hs

+5-36
Original file line numberDiff line numberDiff line change
@@ -110,27 +110,17 @@ import System.IO.Extra (fixIO, newTempFileWithin)
110110

111111
import GHC.Tc.Gen.Splice
112112

113-
#if !MIN_VERSION_ghc(9,2,1)
114-
import GHC.Driver.Types
115-
#endif
116113

117-
#if !MIN_VERSION_ghc(9,2,0)
118-
import qualified Data.IntMap.Strict as IntMap
119-
#endif
120114

121-
#if MIN_VERSION_ghc(9,2,0)
122115
import qualified GHC as G
123-
#endif
124116

125-
#if MIN_VERSION_ghc(9,2,0) && !MIN_VERSION_ghc(9,3,0)
117+
#if !MIN_VERSION_ghc(9,3,0)
126118
import GHC (ModuleGraph)
127119
#endif
128120

129-
#if MIN_VERSION_ghc(9,2,1)
130121
import GHC.Types.ForeignStubs
131122
import GHC.Types.HpcInfo
132123
import GHC.Types.TypeEnv
133-
#endif
134124

135125
#if !MIN_VERSION_ghc(9,3,0)
136126
import Data.Map (Map)
@@ -265,7 +255,6 @@ captureSplicesAndDeps TypecheckHelpers{..} env k = do
265255
; lintInteractiveExpr "hscCompileExpr" hsc_env prepd_expr
266256

267257

268-
#if MIN_VERSION_ghc(9,2,0)
269258
; let iNTERACTIVELoc = G.ModLocation{ ml_hs_file = Nothing,
270259
ml_hi_file = panic "hscCompileCoreExpr':ml_hi_file",
271260
ml_obj_file = panic "hscCompileCoreExpr':ml_obj_file",
@@ -293,11 +282,6 @@ captureSplicesAndDeps TypecheckHelpers{..} env k = do
293282
(icInteractiveModule ictxt)
294283
stg_expr
295284
[] Nothing
296-
#else
297-
{- Convert to BCOs -}
298-
; bcos <- coreExprToBCOs hsc_env
299-
(icInteractiveModule (hsc_IC hsc_env)) prepd_expr
300-
#endif
301285

302286
-- Exclude wired-in names because we may not have read
303287
-- their interface files, so getLinkDeps will fail
@@ -312,11 +296,7 @@ captureSplicesAndDeps TypecheckHelpers{..} env k = do
312296
moduleName mod -- On <= 9.2, just the name is enough because all unit ids will be the same
313297
#endif
314298

315-
#if MIN_VERSION_ghc(9,2,0)
316299
| n <- concatMap (uniqDSetToList . bcoFreeNames) $ bc_bcos bcos
317-
#else
318-
| n <- uniqDSetToList (bcoFreeNames bcos)
319-
#endif
320300
, Just mod <- [nameModule_maybe n] -- Names from other modules
321301
, not (isWiredInName n) -- Exclude wired-in names
322302
, moduleUnitId mod `elem` home_unit_ids -- Only care about stuff from the home package set
@@ -357,13 +337,10 @@ captureSplicesAndDeps TypecheckHelpers{..} env k = do
357337
{- load it -}
358338
; (fv_hvs, lbss, pkgs) <- loadDecls (hscInterp hsc_env') hsc_env' srcspan bcos
359339
; let hval = ((expectJust "hscCompileCoreExpr'" $ lookup (idName binding_id) fv_hvs), lbss, pkgs)
360-
#elif MIN_VERSION_ghc(9,2,0)
340+
#else
361341
{- load it -}
362342
; fv_hvs <- loadDecls (hscInterp hsc_env') hsc_env' srcspan bcos
363343
; let hval = (expectJust "hscCompileCoreExpr'" $ lookup (idName binding_id) fv_hvs)
364-
#else
365-
{- link it -}
366-
; hval <- linkExpr hsc_env' srcspan bcos
367344
#endif
368345

369346
; modifyIORef' var (flip extendModuleEnvList [(mi_module $ hm_iface hm, linkableHash lb) | lb <- lbs, let hm = linkableHomeMod lb])
@@ -881,7 +858,7 @@ generateHieAsts hscEnv tcm =
881858
where
882859
dflags = hsc_dflags hscEnv
883860
run _ts = -- ts is only used in GHC 9.2
884-
#if MIN_VERSION_ghc(9,2,0) && !MIN_VERSION_ghc(9,3,0)
861+
#if !MIN_VERSION_ghc(9,3,0)
885862
fmap (join . snd) . liftIO . initDs hscEnv _ts
886863
#else
887864
id
@@ -1189,15 +1166,15 @@ getModSummaryFromImports env fp _modTime mContents = do
11891166

11901167

11911168
convImport (L _ i) = (
1192-
#if !MIN_VERSION_ghc (9,3,0)
1169+
#if !MIN_VERSION_ghc(9,3,0)
11931170
fmap sl_fs
11941171
#endif
11951172
(ideclPkgQual i)
11961173
, reLoc $ ideclName i)
11971174

11981175
msrImports = implicit_imports ++ imps
11991176

1200-
#if MIN_VERSION_ghc (9,3,0)
1177+
#if MIN_VERSION_ghc(9,3,0)
12011178
rn_pkg_qual = renameRawPkgQual (hsc_unit_env ppEnv)
12021179
rn_imps = fmap (\(pk, lmn@(L _ mn)) -> (rn_pkg_qual mn pk, lmn))
12031180
srcImports = rn_imps $ map convImport src_idecls
@@ -1714,9 +1691,6 @@ getDocsBatch hsc_env _names = do
17141691
#else
17151692
Map.lookup name dmap ,
17161693
#endif
1717-
#if !MIN_VERSION_ghc(9,2,0)
1718-
IntMap.fromAscList $ Map.toAscList $
1719-
#endif
17201694
#if MIN_VERSION_ghc(9,3,0)
17211695
lookupWithDefaultUniqMap amap mempty name))
17221696
#else
@@ -1739,12 +1713,7 @@ lookupName :: HscEnv
17391713
lookupName _ name
17401714
| Nothing <- nameModule_maybe name = pure Nothing
17411715
lookupName hsc_env name = exceptionHandle $ do
1742-
#if MIN_VERSION_ghc(9,2,0)
17431716
mb_thing <- liftIO $ lookupType hsc_env name
1744-
#else
1745-
eps <- liftIO $ readIORef (hsc_EPS hsc_env)
1746-
let mb_thing = lookupType (hsc_dflags hsc_env) (hsc_HPT hsc_env) (eps_PTE eps) name
1747-
#endif
17481717
case mb_thing of
17491718
x@(Just _) -> return x
17501719
Nothing

ghcide/src/Development/IDE/Core/Rules.hs

-9
Original file line numberDiff line numberDiff line change
@@ -697,12 +697,10 @@ dependencyInfoForFiles fs = do
697697
mg = mkModuleGraph mns
698698
#else
699699
let mg = mkModuleGraph $
700-
#if MIN_VERSION_ghc(9,2,0)
701700
-- We don't do any instantiation for backpack at this point of time, so it is OK to use
702701
-- 'extendModSummaryNoDeps'.
703702
-- This may have to change in the future.
704703
map extendModSummaryNoDeps $
705-
#endif
706704
(catMaybes mss)
707705
#endif
708706
pure (fingerprintToBS $ Util.fingerprintFingerprints $ map (maybe fingerprint0 msrFingerprint) msrs, processDependencyInformation rawDepInfo bm mg)
@@ -822,12 +820,10 @@ ghcSessionDepsDefinition fullModSummary GhcSessionDepsConfig{..} env file = do
822820
nubOrdOn mkNodeKey (ModuleNode final_deps ms : concatMap mgModSummaries' mgs)
823821
#else
824822
let module_graph_nodes =
825-
#if MIN_VERSION_ghc(9,2,0)
826823
-- We don't do any instantiation for backpack at this point of time, so it is OK to use
827824
-- 'extendModSummaryNoDeps'.
828825
-- This may have to change in the future.
829826
map extendModSummaryNoDeps $
830-
#endif
831827
nubOrdOn ms_mod (ms : concatMap mgModSummaries mgs)
832828
#endif
833829
liftIO $ evaluate $ liftRnf rwhnf module_graph_nodes
@@ -1219,12 +1215,7 @@ uses_th_qq (ms_hspp_opts -> dflags) =
12191215
-- Depends on whether it uses unboxed tuples or sums
12201216
computeLinkableTypeForDynFlags :: DynFlags -> LinkableType
12211217
computeLinkableTypeForDynFlags d
1222-
#if defined(GHC_PATCHED_UNBOXED_BYTECODE) || MIN_VERSION_ghc(9,2,0)
12231218
= BCOLinkable
1224-
#else
1225-
| _unboxed_tuples_or_sums = ObjectLinkable
1226-
| otherwise = BCOLinkable
1227-
#endif
12281219
where -- unboxed_tuples_or_sums is only used in GHC < 9.2
12291220
_unboxed_tuples_or_sums =
12301221
xopt LangExt.UnboxedTuples d || xopt LangExt.UnboxedSums d

ghcide/src/Development/IDE/GHC/CPP.hs

-4
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,5 @@ doCpp env input_fn output_fn =
6363
let cpp_opts = True in
6464
#endif
6565

66-
#if MIN_VERSION_ghc(9,2,0)
6766
Pipeline.doCpp (hsc_logger env) (hsc_tmpfs env) (hsc_dflags env) (hsc_unit_env env) cpp_opts input_fn output_fn
68-
#else
69-
Pipeline.doCpp (hsc_dflags env) cpp_opts input_fn output_fn
70-
#endif
7167

0 commit comments

Comments
 (0)