on master help sign in
Build on GHC 8.8 (#43)
commit9a5ee23c015d0285f0248cf0d0c9a1a770e8769c authorOllie Charles <ollie@ocharles.org.uk> dateMon 16 Sep 2019, 14:20 (7 years ago) parent7133f41
5 files changed+16−5
exe/Main.hs+11−2 src/Development/IDE/GHC/Compat.hs+2 stack-ghc-lib.yaml+1−1 stack.yaml+1−1 stack84.yaml+1−1
exe/Main.hs+11−2
@@ -41,6 +41,7 @@ import GHC hiding (def)
4141import qualified GHC.Paths
4242
4343import HIE.Bios
44+import HIE.Bios.Ghc.Api (initializeFlagsWithCradle)
4445
4546-- Set the GHC libdir to the nix libdir if it's present.
4647getLibdir :: IO FilePath
@@ -76,7 +77,7 @@ main = do
7677 -- Note that this whole section needs to change once we have genuine
7778 -- multi environment support. Needs rewriting in terms of loadEnvironment.
7879 putStrLn "[1/6] Finding hie-bios cradle"
79− cradle <- findCradle (dir <> "/")
80+ cradle <- getCradle dir
8081 print cradle
8182
8283 putStrLn "\n[2/6] Converting Cradle to GHC session"
@@ -138,5 +139,13 @@ newSession' cradle = getLibdir >>= \libdir -> do
138139
139140loadEnvironment :: FilePath -> IO (FilePath -> Action HscEnvEq)
140141loadEnvironment dir = do
141− res <- liftIO $ newSession' =<< findCradle (dir <> "/")
142+ res <- liftIO $ newSession' =<< getCradle dir
142143 return $ const $ return res
144+
145+getCradle :: FilePath -> IO Cradle
146+getCradle dir = do
147+ dir <- pure $ addTrailingPathSeparator dir
148+ mbYaml <- findCradle dir
149+ case mbYaml of
150+ Nothing -> loadImplicitCradle dir
151+ Just yaml -> loadCradle yaml
src/Development/IDE/GHC/Compat.hs+2
@@ -40,10 +40,12 @@ import System.IO
4040import Foreign.ForeignPtr
4141
4242
43+#if !MIN_GHC_API_VERSION(8,8,0)
4344hPutStringBuffer :: Handle -> StringBuffer -> IO ()
4445hPutStringBuffer hdl (StringBuffer buf len cur)
4546 = withForeignPtr (plusForeignPtr buf cur) $ \ptr ->
4647 hPutBuf hdl ptr len
48+#endif
4749
4850mkHieFile :: ModSummary -> TcGblEnv -> RenamedSource -> Hsc HieFile
4951mkHieFile _ _ _ = return (HieFile () [])
stack-ghc-lib.yaml+1−1
@@ -10,7 +10,7 @@ extra-deps:
1010- git: https://github.com/bubba/lsp-test.git
1111 commit: d126623dc6895d325e3d204d74e2a22d4f515587
1212- git: https://github.com/mpickering/hie-bios.git
13− commit: 89e4ba24f87aac9909d9814b0e8c51b679a0ccd4
13+ commit: 68c662ea1d0e7095ccf2a4e3d393fc524e769bfe
1414- ghc-lib-parser-8.8.1
1515- ghc-lib-8.8.1
1616nix:
stack.yaml+1−1
@@ -11,6 +11,6 @@ extra-deps:
1111- git: https://github.com/bubba/lsp-test.git
1212 commit: d126623dc6895d325e3d204d74e2a22d4f515587
1313- git: https://github.com/mpickering/hie-bios.git
14− commit: 89e4ba24f87aac9909d9814b0e8c51b679a0ccd4
14+ commit: 68c662ea1d0e7095ccf2a4e3d393fc524e769bfe
1515nix:
1616 packages: [zlib]
stack84.yaml+1−1
@@ -15,7 +15,7 @@ extra-deps:
1515- git: https://github.com/bubba/lsp-test.git
1616 commit: d126623dc6895d325e3d204d74e2a22d4f515587
1717- git: https://github.com/mpickering/hie-bios.git
18− commit: 89e4ba24f87aac9909d9814b0e8c51b679a0ccd4
18+ commit: 68c662ea1d0e7095ccf2a4e3d393fc524e769bfe
1919nix:
2020 packages: [zlib]
2121allow-newer: true