Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for GHC 8.10 #3434

Merged
merged 5 commits into from
Aug 31, 2023
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
fail-fast: false
matrix:
ghc:
- '8.10'
- '9.2'
- '9.4'
os:
- ubuntu-latest

Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ['8.10', '9.2']
ghc: ['9.2', '9.4']
os: [ubuntu-latest]
cabal: ['3.10']
example: ['cabal', 'lsp-types']
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/caching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
# Fetching from github cache is faster than doing it from hackage
# Sources does not change per ghc and ghc version son only doing it
# for one matrix job (it is arbitrary)
- if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '8.10'
- if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '9.2'
name: Download sources
run: |
cabal $cabalBuild --only-download --enable-benchmarks --enable-tests
Expand All @@ -117,7 +117,7 @@ jobs:
# We build ghcide with benchs and test enabled to include its dependencies in the cache
# (including shake-bench)
# Only for the same ghc and os used in the bench workflow, so we save cache space
- if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '8.10'
- if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '9.2'
name: Build ghcide benchmark
run: |
cabal $cabalBuild ghcide --enable-benchmarks --enable-tests
2 changes: 1 addition & 1 deletion .github/workflows/supported-ghc-versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ "9.6", "9.4" , "9.2" , "9.0" , "8.10" ]
[ "9.6", "9.4" , "9.2" , "9.0" ]
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ jobs:
run: cabal test hls-explicit-record-fields-plugin --test-options="$TEST_OPTS" || cabal test hls-explicit-record-fields-plugin --test-options="$TEST_OPTS"

## version needs to be limited since the tests depend on cabal-fmt which only builds using specific ghc versions
- if: matrix.test && matrix.ghc == '8.10'
- if: matrix.test && matrix.ghc == '9.2'
name: Test hls-cabal-fmt-plugin test suite
run: cabal test hls-cabal-fmt-plugin --flag=isolateTests --test-options="$TEST_OPTS" || cabal test hls-cabal-fmt-plugin --flag=isolateTests --test-options="$TEST_OPTS"

Expand All @@ -232,7 +232,7 @@ jobs:
name: Test hls-retrie-plugin test suite
run: cabal test hls-retrie-plugin --test-options="$TEST_OPTS" || cabal test hls-retrie-plugin --test-options="$TEST_OPTS"

- if: matrix.test && matrix.ghc != '8.10' && matrix.ghc != '9.0'
- if: matrix.test && matrix.ghc != '9.0'
name: Test hls-overloaded-record-dot-plugin test suite
run: cabal test hls-overloaded-record-dot-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-overloaded-record-dot-plugin --test-options="$TEST_OPTS"

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/plugin-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ And here is the gist of the algorithm:

## Setup

To get started, let’s fetch the HLS repo and build it. You need at least GHC 8.10 for this:
To get started, let’s fetch the HLS repo and build it. You need at least GHC 9.0 for this:

```
git clone --recursive http://github.com/haskell/haskell-language-server hls
Expand Down
3 changes: 1 addition & 2 deletions docs/support/ghc-version-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Support status (see the support policy below for more details):
| 9.2.(1,2) | [1.7.0.0](https://github.com/haskell/haskell-language-server/releases/tag/1.7.0.0) | deprecated |
| 9.0.2 | [latest](https://github.com/haskell/haskell-language-server/releases/latest) | full support |
| 9.0.1 | [1.6.1.0](https://github.com/haskell/haskell-language-server/releases/tag/1.6.1.0) | deprecated |
| 8.10.7 | [latest](https://github.com/haskell/haskell-language-server/releases/latest) | full support |
| 8.10.7 | [2.2.0.0](https://github.com/haskell/haskell-language-server/releases/tag/2.2.0.0) | full support |
| 8.10.6 | [1.6.1.0](https://github.com/haskell/haskell-language-server/releases/tag/1.6.1.0) | deprecated |
| 8.10.5 | [1.5.1](https://github.com/haskell/haskell-language-server/releases/tag/1.5.1) | deprecated |
| 8.10.(4,3,2) | [1.4.0](https://github.com/haskell/haskell-language-server/releases/tag/1.4.0) | deprecated |
Expand All @@ -42,7 +42,6 @@ Support status (see the support policy below for more details):
| 8.6.5 | [1.8.0.0](https://github.com/haskell/haskell-language-server/releases/tag/1.8.0.0) | deprecated |
| 8.6.4 | [1.4.0](https://github.com/haskell/haskell-language-server/releases/tag/1.4.0) | deprecated |


GHC versions not in the list have never been supported by HLS.
LTS stands for [Stackage](https://www.stackage.org/) Long Term Support.

Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ stack install haskell-language-server
You also can leverage `ghcup compile hls`:

```bash
ghcup compile hls -v 1.6.1.0 --ghc 8.10.7
ghcup compile hls -v 1.9.0.0 --ghc 9.2.5
```

### Preprocessors
Expand Down
2 changes: 1 addition & 1 deletion ghcide-bench/ghcide-bench.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ synopsis: An LSP client for running performance experiments on HLS
description: An LSP client for running performance experiments on HLS
homepage: https://github.com/haskell/haskell-language-server/tree/master/ghcide#readme
bug-reports: https://github.com/haskell/haskell-language-server/issues
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.5
tested-with: GHC == 9.0.2 || == 9.2.5

source-repository head
type: git
Expand Down
13 changes: 4 additions & 9 deletions ghcide/ghcide.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description:
A library for building Haskell IDE's on top of the GHC API.
homepage: https://github.com/haskell/haskell-language-server/tree/master/ghcide#readme
bug-reports: https://github.com/haskell/haskell-language-server/issues
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.5
tested-with: GHC == 9.0.2 || == 9.2.5
extra-source-files: README.md CHANGELOG.md
test/data/**/*.project
test/data/**/*.cabal
Expand Down Expand Up @@ -44,7 +44,6 @@ library
default-language: Haskell2010
build-depends:
aeson,
aeson-pretty,
array,
async,
base == 4.*,
Expand Down Expand Up @@ -104,7 +103,7 @@ library
unliftio-core,
ghc-boot-th,
ghc-boot,
ghc >= 8.10,
ghc >= 9.0,
ghc-check >=0.5.0.8,
ghc-paths,
cryptohash-sha1 >=0.11.100 && <0.12,
Expand Down Expand Up @@ -228,6 +227,7 @@ library
-Wall
-Wincomplete-uni-patterns
-Wno-unticked-promoted-constructors
-Wunused-packages
-fno-ignore-asserts

if flag(ghc-patched-unboxed-bytecode)
Expand All @@ -254,9 +254,6 @@ library
if impl(ghc >= 9.2) && flag(pedantic)
ghc-options: -Wwarn=ambiguous-fields

if impl(ghc >= 9)
ghc-options: -Wunused-packages

if flag(ekg)
build-depends:
ekg-wai,
Expand Down Expand Up @@ -397,10 +394,8 @@ test-suite ghcide-tests
record-hasfield
if impl(ghc < 9.3)
build-depends: ghc-typelits-knownnat
if impl(ghc >= 9)
ghc-options: -Wunused-packages
hs-source-dirs: test/cabal test/exe test/src
ghc-options: -threaded -Wall -Wno-name-shadowing -O0 -Wno-unticked-promoted-constructors
ghc-options: -threaded -Wall -Wno-name-shadowing -O0 -Wno-unticked-promoted-constructors -Wunused-packages
main-is: Main.hs
other-modules:
Development.IDE.Test.Runfiles
Expand Down
1 change: 0 additions & 1 deletion ghcide/session-loader/Development/IDE/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@
void $ modifyVar' fileToFlags $
Map.insert hieYaml (HM.fromList (concatMap toFlagsMap all_targets))
void $ modifyVar' filesMap $
flip HM.union (HM.fromList (zip (map fst $ concatMap toFlagsMap all_targets) (repeat hieYaml)))

Check warning on line 621 in ghcide/session-loader/Development/IDE/Session.hs

View workflow job for this annotation

GitHub Actions / Hlint check run

Warning in loadSessionWithOptions in module Development.IDE.Session: Use map ▫︎ Found: "zip (map fst $ concatMap toFlagsMap all_targets) (repeat hieYaml)" ▫︎ Perhaps: "map (, hieYaml) (map fst $ concatMap toFlagsMap all_targets)" ▫︎ Note: may require `{-# LANGUAGE TupleSections #-}` adding to the top of the file

void $ extendKnownTargets all_targets

Expand Down Expand Up @@ -768,7 +768,6 @@
#endif
emptyHscEnv nc libDir = do
env <- runGhc (Just libDir) getSession
initDynLinker env
pure $ setNameCache nc (hscSetFlags ((hsc_dflags env){useUnicode = True }) env)

data TargetDetails = TargetDetails
Expand Down Expand Up @@ -823,7 +822,7 @@
-> IO ( [TargetDetails], (IdeResult HscEnvEq, DependencyInfo))
newComponentCache recorder exts cradlePath cfp hsc_env uids ci = do
let df = componentDynFlags ci
hscEnv' <-

Check warning on line 825 in ghcide/session-loader/Development/IDE/Session.hs

View workflow job for this annotation

GitHub Actions / Hlint check run

Suggestion in newComponentCache in module Development.IDE.Session: Use let ▫︎ Found: "hscEnv' <- pure\n $ hscSetFlags\n df hsc_env {hsc_IC = (hsc_IC hsc_env) {ic_dflags = df}}" ▫︎ Perhaps: "let hscEnv'\n = hscSetFlags\n df hsc_env {hsc_IC = (hsc_IC hsc_env) {ic_dflags = df}}"
#if MIN_VERSION_ghc(9,3,0)
-- Set up a multi component session with the other units on GHC 9.4
Compat.initUnits (map snd uids) (hscSetFlags df hsc_env)
Expand Down Expand Up @@ -975,7 +974,7 @@
surround start s end = do
guard (listToMaybe s == Just start)
guard (listToMaybe (reverse s) == Just end)
pure $ drop 1 $ take (length s - 1) s

Check warning on line 977 in ghcide/session-loader/Development/IDE/Session.hs

View workflow job for this annotation

GitHub Actions / Hlint check run

Warning in parseMultiCradleErr in module Development.IDE.Session: Use drop1 ▫︎ Found: "drop 1" ▫︎ Perhaps: "drop1"

multiCradleErrMessage :: MultiCradleErr -> [String]
multiCradleErrMessage e =
Expand Down
31 changes: 4 additions & 27 deletions ghcide/src/Development/IDE/Core/Compile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
import Development.IDE.Types.Diagnostics
import Development.IDE.Types.Location
import Development.IDE.Types.Options
import GHC (ForeignHValue,

Check warning on line 95 in ghcide/src/Development/IDE/Core/Compile.hs

View workflow job for this annotation

GitHub Actions / Hlint check run

Warning in module Development.IDE.Core.Compile: Use fewer imports ▫︎ Found: "import GHC ( ForeignHValue, GetDocsFailure(..), parsedSource )\nimport GHC ( GhcException(..) )\n" ▫︎ Perhaps: "import GHC\n ( ForeignHValue,\n GetDocsFailure(..),\n parsedSource,\n GhcException(..) )\n"
GetDocsFailure (..),
parsedSource)
import qualified GHC.LanguageExtensions as LangExt
Expand All @@ -108,16 +108,9 @@

-- See Note [Guidelines For Using CPP In GHCIDE Import Statements]

#if !MIN_VERSION_ghc(9,0,1)
import HscTypes
import TcSplice
#endif

#if MIN_VERSION_ghc(9,0,1)
import GHC.Tc.Gen.Splice
#endif

#if MIN_VERSION_ghc(9,0,1) && !MIN_VERSION_ghc(9,2,1)
#if !MIN_VERSION_ghc(9,2,1)
import GHC.Driver.Types
#endif

Expand Down Expand Up @@ -305,7 +298,7 @@
-- by default, so we can safely ignore them here.

-- Find the linkables for the modules we need
; let needed_mods = mkUniqSet [

Check warning on line 301 in ghcide/src/Development/IDE/Core/Compile.hs

View workflow job for this annotation

GitHub Actions / Hlint check run

Suggestion in captureSplicesAndDeps in module Development.IDE.Core.Compile: Move guards forward ▫︎ Found: "[moduleName mod |\n n <- uniqDSetToList (bcoFreeNames bcos),\n Just mod <- [nameModule_maybe n],\n not (isWiredInName n),\n moduleUnitId mod `elem` home_unit_ids]" ▫︎ Perhaps: "[moduleName mod |\n n <- uniqDSetToList (bcoFreeNames bcos),\n not (isWiredInName n),\n Just mod <- [nameModule_maybe n],\n moduleUnitId mod `elem` home_unit_ids]"
#if MIN_VERSION_ghc(9,3,0)
mod -- We need the whole module for 9.4 because of multiple home units modules may have different unit ids
#else
Expand Down Expand Up @@ -525,7 +518,6 @@
(guts, details) <- tidyProgram tidy_opts simplified_guts
pure (details, guts)

#if MIN_VERSION_ghc(9,0,1)
let !partial_iface = force $ mkPartialIface session
#if MIN_VERSION_ghc(9,5,0)
(cg_binds guts)
Expand All @@ -540,11 +532,6 @@
#if MIN_VERSION_ghc(9,4,2)
Nothing
#endif

#else
let !partial_iface = force (mkPartialIface session details simplified_guts)
final_iface' <- mkFullIface session partial_iface
#endif
let final_iface = final_iface' {mi_globals = Nothing, mi_usages = filterUsages (mi_usages final_iface')} -- See Note [Clearing mi_globals after generating an iface]

-- Write the core file now
Expand Down Expand Up @@ -619,7 +606,7 @@
-- SYB is slow but fine given that this is only used for testing
noUnfoldings = everywhere $ mkT $ \v -> if isId v
then
let v' = if isOtherUnfolding (realIdUnfolding v) then (setIdUnfolding v noUnfolding) else v

Check warning on line 609 in ghcide/src/Development/IDE/Core/Compile.hs

View workflow job for this annotation

GitHub Actions / Hlint check run

Suggestion in mkHiFileResultCompile in module Development.IDE.Core.Compile: Redundant bracket ▫︎ Found: "if isOtherUnfolding (realIdUnfolding v) then\n (setIdUnfolding v noUnfolding)\nelse\n v" ▫︎ Perhaps: "if isOtherUnfolding (realIdUnfolding v) then\n setIdUnfolding v noUnfolding\nelse\n v"
in setIdOccInfo v' noOccInfo
else v
isOtherUnfolding (OtherCon _) = True
Expand Down Expand Up @@ -693,10 +680,8 @@
session' = hscSetFlags newFlags session
#if MIN_VERSION_ghc(9,4,2)
(outputFilename, _mStub, _foreign_files, _cinfos, _stgcinfos) <- hscGenHardCode session' guts
#elif MIN_VERSION_ghc(9,0,1)
(outputFilename, _mStub, _foreign_files, _cinfos) <- hscGenHardCode session' guts
#else
(outputFilename, _mStub, _foreign_files) <- hscGenHardCode session' guts
(outputFilename, _mStub, _foreign_files, _cinfos) <- hscGenHardCode session' guts
#endif
(ms_location summary)
fp
Expand Down Expand Up @@ -839,7 +824,6 @@
-- don't export an interface which allows for additional information to be added to hie files.
let fake_splice_binds = Util.listToBag (map (mkVarBind unitDataConId) (spliceExpressions $ tmrTopLevelSplices tcm))
real_binds = tcg_binds $ tmrTypechecked tcm
#if MIN_VERSION_ghc(9,0,1)
ts = tmrTypechecked tcm :: TcGblEnv
top_ev_binds = tcg_ev_binds ts :: Util.Bag EvBind
insts = tcg_insts ts :: [ClsInst]
Expand All @@ -851,19 +835,14 @@
Just <$>
#endif
GHC.enrichHie (fake_splice_binds `Util.unionBags` real_binds) (tmrRenamed tcm) top_ev_binds insts tcs
#else
Just <$> GHC.enrichHie (fake_splice_binds `Util.unionBags` real_binds) (tmrRenamed tcm)
#endif
where
dflags = hsc_dflags hscEnv
#if MIN_VERSION_ghc(9,0,0)
run _ts = -- ts is only used in GHC 9.2
#if MIN_VERSION_ghc(9,2,0) && !MIN_VERSION_ghc(9,3,0)
fmap (join . snd) . liftIO . initDs hscEnv _ts
#else
id
#endif
#endif

spliceExpressions :: Splices -> [LHsExpr GhcTc]
spliceExpressions Splices{..} =
Expand Down Expand Up @@ -1258,10 +1237,8 @@
-> Util.StringBuffer -- ^ Haskell module source text (full Unicode is supported)
#if MIN_VERSION_ghc(9,5,0)
-> ExceptT [FileDiagnostic] m ([FileDiagnostic], Located(HsModule GhcPs))
#elif MIN_VERSION_ghc(9,0,1)
-> ExceptT [FileDiagnostic] m ([FileDiagnostic], Located(HsModule))
#else
-> ExceptT [FileDiagnostic] m ([FileDiagnostic], Located(HsModule GhcPs))
-> ExceptT [FileDiagnostic] m ([FileDiagnostic], Located(HsModule))

Check warning on line 1241 in ghcide/src/Development/IDE/Core/Compile.hs

View workflow job for this annotation

GitHub Actions / Hlint check run

Warning in parseHeader in module Development.IDE.Core.Compile: Redundant bracket ▫︎ Found: "(HsModule)" ▫︎ Perhaps: "HsModule"
#endif
parseHeader dflags filename contents = do
let loc = mkRealSrcLoc (Util.mkFastString filename) 1 1
Expand Down Expand Up @@ -1774,4 +1751,4 @@
GHC numbers is identical, with the only preference being to use what is
already there. (i.e. (`MIN_VERSION_GHC(9,2,0)` and `MIN_VERSION_GHC(9,1,0)`
are functionally equivalent)
-}
-}
9 changes: 1 addition & 8 deletions ghcide/src/Development/IDE/GHC/CPP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,9 @@ import GHC

-- See Note [Guidelines For Using CPP In GHCIDE Import Statements]

#if MIN_VERSION_ghc (8,10,0) && !MIN_VERSION_ghc(9,0,0)
import qualified DriverPipeline as Pipeline
import ToolSettings
#endif

#if MIN_VERSION_ghc(9,0,0)
import GHC.Settings
#endif

#if MIN_VERSION_ghc(9,0,0) && !MIN_VERSION_ghc(9,3,0)
#if !MIN_VERSION_ghc(9,3,0)
import qualified GHC.Driver.Pipeline as Pipeline
#endif

Expand Down
Loading
Loading