Skip to content

Use unreleased hie-bios 0.16 #4647

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -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: 4ee6772eeae5882573c67f74a7f3752fdaa250c0
3 changes: 3 additions & 0 deletions ghcide-test/data/multi-unit/a-1.0.0-inplace
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ base
text
-XHaskell98
A
+RTS
-A32M
-RTS
2 changes: 2 additions & 0 deletions ghcide-test/data/multi-unit/c-1.0.0-inplace
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ a-1.0.0-inplace
base
-XHaskell98
C
+RTS
-A32M
6 changes: 5 additions & 1 deletion ghcide-test/exe/CradleTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion ghcide/session-loader/Development/IDE/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
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,
Expand Down Expand Up @@ -627,7 +628,7 @@
[] -> error $ "GHC version could not be parsed: " <> version
((runTime, _):_)
| compileTime == runTime -> do
atomicModifyIORef' cradle_files (\xs -> (cfp:xs,()))

Check warning on line 631 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 atomicModifyIORef'_ ▫︎ Found: "atomicModifyIORef' cradle_files (\\ xs -> (cfp : xs, ()))" ▫︎ Perhaps: "atomicModifyIORef'_ cradle_files ((:) cfp)"
session (hieYaml, toNormalizedFilePath' cfp, opts, libDir)
| otherwise -> return (([renderPackageSetupException cfp GhcVersionMismatch{..}], Nothing),[])
-- Failure case, either a cradle error or the none cradle
Expand Down Expand Up @@ -894,7 +895,7 @@
x <- map errMsgDiagnostic closure_errs
DriverHomePackagesNotClosed us <- pure x
pure us
isBad ci = (homeUnitId_ (componentDynFlags ci)) `OS.member` bad_units

Check warning on line 898 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: Redundant bracket ▫︎ Found: "(homeUnitId_ (componentDynFlags ci)) `OS.member` bad_units" ▫︎ Perhaps: "homeUnitId_ (componentDynFlags ci) `OS.member` bad_units"
-- Whenever we spin up a session on Linux, dynamically load libm.so.6
-- in. We need this in case the binary is statically linked, in which
-- case the interactive session will fail when trying to load
Expand Down Expand Up @@ -1144,7 +1145,10 @@
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'' =
Expand Down
Loading