Skip to content

Commit f85aac2

Browse files
committed
GHC 9.12 support
wip disable all plugins for 9.12.0 wip
1 parent 93fed3e commit f85aac2

File tree

37 files changed

+553
-112
lines changed

37 files changed

+553
-112
lines changed

cabal.project

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ packages:
88
./hls-test-utils
99

1010

11-
index-state: 2024-12-02T00:00:00Z
11+
index-state: 2025-03-20T00:00:00Z
1212

1313
tests: True
1414
test-show-details: direct
@@ -59,3 +59,13 @@ if impl(ghc >= 9.8.4) && impl(ghc < 9.8.5)
5959
ghc-lib-parser:filepath
6060
constraints:
6161
ghc-lib-parser==9.8.4.20241130
62+
63+
if impl(ghc >= 9.11)
64+
allow-newer:
65+
hiedb:base,
66+
hiedb:ghc,
67+
hie-bios:ghc,
68+
ghc-trace-events:base,
69+
tasty-hspec:base,
70+
cabal-install-parsers:base,
71+
cabal-install-parsers:time,

ghcide-test/exe/ExceptionTests.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Control.Monad.Error.Class (MonadError (throwError))
88
import Control.Monad.IO.Class (liftIO)
99
import qualified Data.Aeson as A
1010
import Data.Default (Default (..))
11-
import Data.Text as T
11+
import qualified Data.Text as T
1212
import Development.IDE.Core.Shake (IdeState (..))
1313
import qualified Development.IDE.LSP.Notifications as Notifications
1414
import Development.IDE.Plugin.HLS (toResponseError)

ghcide-test/exe/UnitTests.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import qualified Progress
2929
import System.IO.Extra hiding (withTempDir)
3030
import System.Mem (performGC)
3131
import Test.Hls (IdeState, def,
32+
ignoreForGhcVersions,
33+
GhcVersion(..),
3234
runSessionWithServerInTmpDir,
3335
waitForProgressDone)
3436
import Test.Tasty
@@ -97,7 +99,7 @@ tests = do
9799
let msg = printf "Timestamps do not have millisecond resolution: %dus" resolution_us
98100
assertBool msg (resolution_us <= 1000)
99101
, Progress.tests
100-
, FuzzySearch.tests
102+
, ignoreForGhcVersions [GHC912] "Fuzzy search: ignore since referenceImplementation get stuck for ghc912" $ FuzzySearch.tests
101103
]
102104

103105
findResolution_us :: Int -> IO Int

ghcide/ghcide.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ library
8787
, mtl
8888
, opentelemetry >=0.6.1
8989
, optparse-applicative
90+
, os-string
9091
, parallel
9192
, prettyprinter >=1.7
9293
, prettyprinter-ansi-terminal

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ import GHC.Types.Error (errMsgDiagnostic,
124124
singleMessage)
125125
import GHC.Unit.State
126126

127+
#if MIN_VERSION_ghc(9,13,0)
128+
import GHC.Driver.Make (checkHomeUnitsClosed)
129+
#endif
130+
127131
data Log
128132
= LogSettingInitialDynFlags
129133
| LogGetInitialGhcLibDirDefaultCradleFail !CradleError !FilePath !(Maybe FilePath) !(Cradle Void)
@@ -782,6 +786,11 @@ toFlagsMap TargetDetails{..} =
782786
setNameCache :: NameCache -> HscEnv -> HscEnv
783787
setNameCache nc hsc = hsc { hsc_NC = nc }
784788

789+
#if MIN_VERSION_ghc(9,13,0)
790+
-- Moved back to implementation in GHC.
791+
checkHomeUnitsClosed' :: UnitEnv -> OS.Set UnitId -> [DriverMessages]
792+
checkHomeUnitsClosed' ue _ = checkHomeUnitsClosed ue
793+
#elif MIN_VERSION_ghc(9,3,0)
785794
-- This function checks the important property that if both p and q are home units
786795
-- then any dependency of p, which transitively depends on q is also a home unit.
787796
-- GHC had an implementation of this function, but it was horribly inefficient
@@ -838,6 +847,7 @@ checkHomeUnitsClosed' ue home_id_set
838847
Just depends ->
839848
let todo'' = (depends OS.\\ done) `OS.union` todo'
840849
in DigraphNode uid uid (OS.toList depends) : go (OS.insert uid done) todo''
850+
#endif
841851

842852
-- | Create a mapping from FilePaths to HscEnvEqs
843853
-- This combines all the components we know about into

0 commit comments

Comments
 (0)