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

Purge GHC 8.8 #3287

Merged
merged 4 commits into from
Oct 18, 2022
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
6 changes: 0 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ defaults: &defaults

version: 2
jobs:
stackage-lts16:
environment:
- STACK_FILE: "stack-lts16.yaml"
<<: *defaults

stackage-lts19:
environment:
- STACK_FILE: "stack-lts19.yaml"
Expand All @@ -95,6 +90,5 @@ workflows:
version: 2
multiple-ghcs:
jobs:
- stackage-lts16
- stackage-lts19
- stackage-nightly
1 change: 0 additions & 1 deletion .github/workflows/caching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
, "9.2.3"
, "9.0.2"
, "8.10.7"
, "8.8.4"
]
os: [ "ubuntu-latest"
, "macOS-latest"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/flags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
ghc: [ "9.2.4"
, "9.0.2"
, "8.10.7"
, "8.8.4"
]
os: [ "ubuntu-latest"
]
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/hackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
"haskell-language-server"]
ghc: [ "9.0.2"
, "8.10.7"
, "8.8.4"
]
exclude:
- ghc: "9.0.2"
Expand Down
67 changes: 30 additions & 37 deletions .github/workflows/test.yml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ RUN sudo install-packages build-essential curl libffi-dev libffi7 libgmp-dev lib
echo 'export PATH=$HOME/.cabal/bin:$HOME/.local/bin:$PATH' >> $HOME/.bashrc && \
. /home/gitpod/.ghcup/env && \
# Install all verions of GHC that HLS supports. Putting GHC into Docker image makes workspace start much faster.
ghcup install ghc 8.8.4 && \
ghcup install ghc 8.10.7 && \
ghcup install ghc 9.0.2 && \
ghcup install ghc 9.2.3 && \
Expand Down
1 change: 0 additions & 1 deletion bindist/ghcs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
8.8.4,cabal.project
8.10.7,cabal.project
9.0.2,cabal.project
9.2.3,cabal.project
Expand Down
8 changes: 2 additions & 6 deletions docs/contributing/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,14 @@ If you are using nix 2.4 style command (enabled by `experimental-features = nix-
you can use `nix develop` instead of `nix-shell` to enter the development shell. To enter the shell with specific GHC versions:

* `nix develop` or `nix develop .#haskell-language-server-dev` - default GHC version
* `nix develop .#haskell-language-server-8107-dev` - GHC 8.10.7
* `nix develop .#haskell-language-server-884-dev` - GHC 8.8.4
* `nix develop .#haskell-language-server-901-dev` - GHC 9.0.1
* `nix develop .#haskell-language-server-901-dev` - GHC 9.0.1 (substitute GHC version as appropriate)

If you are looking for a Nix expression to create haskell-language-server binaries, see https://github.com/haskell/haskell-language-server/issues/122

To create binaries:

* `nix build` or `nix build .#haskell-language-server` - default GHC version
* `nix build .#haskell-language-server-8107` - GHC 8.10.7
* `nix build .#haskell-language-server-884` - GHC 8.8.4
* `nix build .#haskell-language-server-901` - GHC 9.0.1
* `nix build .#haskell-language-server-901` - GHC 9.0.1 (substitute GHC version as appropriate)

## Testing

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.8 for this:
To get started, let’s fetch the HLS repo and build it. You need at least GHC 8.10 for this:

```
git clone --recursive http://github.com/haskell/haskell-language-server hls
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Homebrew users can install `haskell-language-server` using the following command
brew install haskell-language-server
```

This formula contains HLS binaries compiled with GHC versions available via Homebrew; at the moment those are: 8.8.4, 8.10.7.
This formula contains HLS binaries compiled with GHC versions available via Homebrew; at the moment those are: 8.10.7.

You need to provide your own GHC/Cabal/Stack as required by your project, possibly via Homebrew.

Expand Down
2 changes: 1 addition & 1 deletion docs/support/ghc-version-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Support status (see the support policy below for more details):
| 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 |
| 8.10.1 | [0.9.0](https://github.com/haskell/haskell-language-server/releases/tag/0.9.0) | deprecated |
| 8.8.4 | [latest](https://github.com/haskell/haskell-language-server/releases/latest) | full support, will be deprecated after LTS and HLS full support for ghc-9.2 |
| 8.8.4 | [1.8.0](https://github.com/haskell/haskell-language-server/releases/1.8.0) | deprecated |
| 8.8.3 | [1.5.1](https://github.com/haskell/haskell-language-server/releases/1.5.1) | deprecated |
| 8.8.2 | [1.2.0](https://github.com/haskell/haskell-language-server/releases/tag/1.2.0) | deprecated |
| 8.6.5 | [1.8.0.0](https://github.com/haskell/haskell-language-server/releases/tag/1.8.0.0) | deprecated |
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.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.3 || == 9.2.4
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.3 || == 9.2.4

source-repository head
type: git
Expand Down
4 changes: 2 additions & 2 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.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.3 || == 9.2.4
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.3 || == 9.2.4
extra-source-files: README.md CHANGELOG.md
test/data/**/*.project
test/data/**/*.cabal
Expand Down Expand Up @@ -99,7 +99,7 @@ library
unliftio-core,
ghc-boot-th,
ghc-boot,
ghc >= 8.8,
ghc >= 8.10,
ghc-check >=0.5.0.8,
ghc-paths,
cryptohash-sha1 >=0.11.100 && <0.12,
Expand Down
18 changes: 1 addition & 17 deletions ghcide/src/Development/IDE/Core/Compile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ import System.FilePath
import System.IO.Extra (fixIO, newTempFileWithin)
import Unsafe.Coerce

#if !MIN_VERSION_ghc(8,10,0)
import ErrUtils
#endif

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

Expand Down Expand Up @@ -482,11 +478,9 @@ mkHiFileResultCompile se session' tcm simplified_guts = catchErrs $ do
Nothing
#endif

#elif MIN_VERSION_ghc(8,10,0)
#else
let !partial_iface = force (mkPartialIface session details simplified_guts)
final_iface <- mkFullIface session partial_iface
#else
(final_iface,_) <- mkIface session Nothing details simplified_guts
#endif

-- Write the core file now
Expand Down Expand Up @@ -637,11 +631,7 @@ generateObjectCode session summary guts = do
#else
(outputFilename, _mStub, _foreign_files) <- hscGenHardCode session' guts
#endif
#if MIN_VERSION_ghc(8,10,0)
(ms_location summary)
#else
summary
#endif
fp
obj <- compileFile session' driverNoStop (outputFilename, Just (As False))
#if MIN_VERSION_ghc(9,3,0)
Expand Down Expand Up @@ -670,11 +660,7 @@ generateByteCode (CoreFileTime time) hscEnv summary guts = do
-- TODO: maybe settings ms_hspp_opts is unnecessary?
summary' = summary { ms_hspp_opts = hsc_dflags session }
hscInteractive session guts
#if MIN_VERSION_ghc(8,10,0)
(ms_location summary')
#else
summary'
#endif
let unlinked = BCOs bytecode sptEntries
let linkable = LM time (ms_mod summary) [unlinked]
pure (map snd warnings, linkable)
Expand Down Expand Up @@ -739,9 +725,7 @@ unnecessaryDeprecationWarningFlags
, Opt_WarnUnusedMatches
, Opt_WarnUnusedTypePatterns
, Opt_WarnUnusedForalls
#if MIN_VERSION_ghc(8,10,0)
, Opt_WarnUnusedRecordWildcards
#endif
, Opt_WarnInaccessibleCode
, Opt_WarnWarningsDeprecations
]
Expand Down
23 changes: 3 additions & 20 deletions ghcide/src/Development/IDE/GHC/CPP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,34 @@ module Development.IDE.GHC.CPP(doCpp, addOptP)
where

import Development.IDE.GHC.Compat as Compat
import GHC
#if !MIN_VERSION_ghc(8,10,0)
import qualified Development.IDE.GHC.Compat.CPP as CPP
#else
import Development.IDE.GHC.Compat.Util
#endif
import GHC

#if MIN_VERSION_ghc(9,0,0)
import qualified GHC.Driver.Pipeline as Pipeline
import GHC.Settings
#else
#if MIN_VERSION_ghc (8,10,0)
#elif MIN_VERSION_ghc (8,10,0)
import qualified DriverPipeline as Pipeline
import ToolSettings
#else
import DynFlags
#endif
#endif
#if MIN_VERSION_ghc(9,3,0)
import qualified GHC.Driver.Pipeline.Execute as Pipeline
#endif

addOptP :: String -> DynFlags -> DynFlags
#if MIN_VERSION_ghc (8,10,0)
addOptP f = alterToolSettings $ \s -> s
{ toolSettings_opt_P = f : toolSettings_opt_P s
, toolSettings_opt_P_fingerprint = fingerprintStrings (f : toolSettings_opt_P s)
}
where
fingerprintStrings ss = fingerprintFingerprints $ map fingerprintString ss
alterToolSettings f dynFlags = dynFlags { toolSettings = f (toolSettings dynFlags) }
#else
addOptP opt = onSettings (onOptP (opt:))
where
onSettings f x = x{settings = f $ settings x}
onOptP f x = x{sOpt_P = f $ sOpt_P x}
#endif

doCpp :: HscEnv -> Bool -> FilePath -> FilePath -> IO ()
doCpp env raw input_fn output_fn =
#if MIN_VERSION_ghc (9,2,0)
Pipeline.doCpp (hsc_logger env) (hsc_tmpfs env) (hsc_dflags env) (hsc_unit_env env) raw input_fn output_fn
#elif MIN_VERSION_ghc (8,10,0)
Pipeline.doCpp (hsc_dflags env) raw input_fn output_fn
#else
CPP.doCpp (hsc_dflags env) raw input_fn output_fn
Pipeline.doCpp (hsc_dflags env) raw input_fn output_fn
#endif

26 changes: 2 additions & 24 deletions ghcide/src/Development/IDE/GHC/Compat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,6 @@ import Data.List (foldl')
import qualified Data.Map as Map
import qualified Data.Set as S

#if !MIN_VERSION_ghc(8,10,0)
import Bag (unitBag)
#endif

#if MIN_VERSION_ghc(9,2,0)
import GHC.Builtin.Uniques
import GHC.ByteCode.Types
Expand Down Expand Up @@ -404,17 +400,10 @@ pattern PFailedWithErrorMessages msgs
#else
<- PFailed (const . fmap pprError . getErrorMessages -> msgs)
#endif
#elif MIN_VERSION_ghc(8,10,0)
pattern PFailedWithErrorMessages :: (DynFlags -> ErrorMessages) -> ParseResult a
pattern PFailedWithErrorMessages msgs
<- PFailed (getErrorMessages -> msgs)
#else
pattern PFailedWithErrorMessages :: (DynFlags -> ErrorMessages) -> ParseResult a
pattern PFailedWithErrorMessages msgs
<- ((fmap.fmap) unitBag . mkPlainErrMsgIfPFailed -> Just msgs)

mkPlainErrMsgIfPFailed (PFailed _ pst err) = Just (\dflags -> mkPlainErrMsg dflags pst err)
mkPlainErrMsgIfPFailed _ = Nothing
<- PFailed (getErrorMessages -> msgs)
#endif
{-# COMPLETE POk, PFailedWithErrorMessages #-}

Expand Down Expand Up @@ -488,24 +477,16 @@ nameListFromAvails as =


getModuleHash :: ModIface -> Fingerprint
#if MIN_VERSION_ghc(8,10,0)
getModuleHash = mi_mod_hash . mi_final_exts
#else
getModuleHash = mi_mod_hash
#endif


disableWarningsAsErrors :: DynFlags -> DynFlags
disableWarningsAsErrors df =
flip gopt_unset Opt_WarnIsError $ foldl' wopt_unset_fatal df [toEnum 0 ..]

isQualifiedImport :: ImportDecl a -> Bool
#if MIN_VERSION_ghc(8,10,0)
isQualifiedImport ImportDecl{ideclQualified = NotQualified} = False
isQualifiedImport ImportDecl{} = True
#else
isQualifiedImport ImportDecl{ideclQualified} = ideclQualified
#endif
isQualifiedImport _ = False


Expand Down Expand Up @@ -566,8 +547,7 @@ generatedNodeInfo = sourceNodeInfo -- before ghc 9.0, we don't distinguish the s
#endif

data GhcVersion
= GHC88
| GHC810
= GHC810
| GHC90
| GHC92
| GHC94
Expand All @@ -585,8 +565,6 @@ ghcVersion = GHC92
ghcVersion = GHC90
#elif MIN_VERSION_GLASGOW_HASKELL(8,10,0,0)
ghcVersion = GHC810
#elif MIN_VERSION_GLASGOW_HASKELL(8,8,0,0)
ghcVersion = GHC88
#endif

runUnlit :: Logger -> DynFlags -> [Option] -> IO ()
Expand Down
4 changes: 0 additions & 4 deletions ghcide/src/Development/IDE/GHC/Compat/CPP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ doCpp dflags raw input_fn output_fn = do
let verbFlags = getVerbFlags dflags

let cpp_prog args | raw = SysTools.runCpp dflags args
#if MIN_VERSION_ghc(8,10,0)
| otherwise = SysTools.runCc Nothing
#else
| otherwise = SysTools.runCc
#endif
dflags (SysTools.Option "-E" : args)

let target_defs =
Expand Down
Loading