From 4d29f07a61f05cf1b63b84072a243edd57ddd251 Mon Sep 17 00:00:00 2001 From: fendor Date: Fri, 4 Jul 2025 18:16:47 +0200 Subject: [PATCH 1/3] Use unreleased hie-bios 0.16 --- cabal.project | 5 +++++ ghcide/ghcide.cabal | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index 92954ec729..6b9a3860ee 100644 --- a/cabal.project +++ b/cabal.project @@ -57,3 +57,8 @@ if impl(ghc >= 9.11) allow-newer: cabal-install-parsers:base, cabal-install-parsers:time, + +source-repository-package + type: git + location: https://github.com/fendor/hie-bios.git + tag: adcd3e20e0e57ce25f5bc3e635d819592f9d9a6a diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index 416e389f2f..2fcca48d6d 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -73,7 +73,7 @@ library , Glob , haddock-library >=1.8 && <1.12 , hashable - , hie-bios ^>=0.15.0 + , hie-bios ^>=0.16.0 , hie-compat ^>=0.3.0.0 , hiedb ^>= 0.7.0.0 , hls-graph == 2.11.0.0 From 8babfe1668dd4062902b5b5d2a7d7963c6eeb0db Mon Sep 17 00:00:00 2001 From: fendor Date: Fri, 4 Jul 2025 18:25:45 +0200 Subject: [PATCH 2/3] Strip RTS and verbosity flags after -unit flag parsing --- ghcide/session-loader/Development/IDE/Session.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ghcide/session-loader/Development/IDE/Session.hs b/ghcide/session-loader/Development/IDE/Session.hs index 1bcec71181..a1b8c8c9a9 100644 --- a/ghcide/session-loader/Development/IDE/Session.hs +++ b/ghcide/session-loader/Development/IDE/Session.hs @@ -70,6 +70,7 @@ import qualified HIE.Bios as HieBios import HIE.Bios.Environment hiding (getCacheDir) import HIE.Bios.Types hiding (Log) import qualified HIE.Bios.Types as HieBios +import qualified HIE.Bios.Cradle.Utils as HieBios import Ide.Logger (Pretty (pretty), Priority (Debug, Error, Info, Warning), Recorder, WithPriority, @@ -1144,7 +1145,10 @@ setOptions cfp (ComponentOptions theOpts compRoot _) dflags rootDir = do initMulti unitArgFiles = forM unitArgFiles $ \f -> do args <- liftIO $ expandResponse [f] - initOne args + -- The reponse files may contain arguments like "+RTS", + -- and hie-bios doesn't expand the response files of @-unit@ arguments. + -- Thus, we need to do the stripping here. + initOne $ HieBios.removeRTS $ HieBios.removeVerbosityOpts args initOne this_opts = do (dflags', targets') <- addCmdOpts this_opts dflags let dflags'' = From a939950a2ac5020438de9e14ed0d154caab70bc4 Mon Sep 17 00:00:00 2001 From: fendor Date: Fri, 4 Jul 2025 18:35:01 +0200 Subject: [PATCH 3/3] Add RTS flags to test cases to make sure they are stripped out --- ghcide-test/data/multi-unit/a-1.0.0-inplace | 3 +++ ghcide-test/data/multi-unit/c-1.0.0-inplace | 2 ++ ghcide-test/exe/CradleTests.hs | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ghcide-test/data/multi-unit/a-1.0.0-inplace b/ghcide-test/data/multi-unit/a-1.0.0-inplace index a54ea9bc4b..cab2b716ff 100644 --- a/ghcide-test/data/multi-unit/a-1.0.0-inplace +++ b/ghcide-test/data/multi-unit/a-1.0.0-inplace @@ -16,3 +16,6 @@ base text -XHaskell98 A ++RTS +-A32M +-RTS diff --git a/ghcide-test/data/multi-unit/c-1.0.0-inplace b/ghcide-test/data/multi-unit/c-1.0.0-inplace index 7201a40de4..7421d59279 100644 --- a/ghcide-test/data/multi-unit/c-1.0.0-inplace +++ b/ghcide-test/data/multi-unit/c-1.0.0-inplace @@ -17,3 +17,5 @@ a-1.0.0-inplace base -XHaskell98 C ++RTS +-A32M diff --git a/ghcide-test/exe/CradleTests.hs b/ghcide-test/exe/CradleTests.hs index 046b8bbf2f..d79b90c835 100644 --- a/ghcide-test/exe/CradleTests.hs +++ b/ghcide-test/exe/CradleTests.hs @@ -117,7 +117,11 @@ simpleSubDirectoryTest = multiTests :: FilePath -> [TestTree] multiTests dir = - [simpleMultiTest dir, simpleMultiTest2 dir, simpleMultiTest3 dir, simpleMultiDefTest dir] + [ simpleMultiTest dir + , simpleMultiTest2 dir + , simpleMultiTest3 dir + , simpleMultiDefTest dir + ] multiTestName :: FilePath -> String -> String multiTestName dir name = "simple-" ++ dir ++ "-" ++ name