From 98159a86de21559902d3b67fb03c6562ae119f69 Mon Sep 17 00:00:00 2001 From: Fendor Date: Fri, 1 Mar 2024 13:40:16 +0100 Subject: [PATCH 1/2] Exit with non-zero exitcode if wrapper fails to launch Only when in LSP mode, we want to launch the LSP server that offers the restart capability. --- exe/Wrapper.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exe/Wrapper.hs b/exe/Wrapper.hs index 128b369e2c..020f842dd4 100644 --- a/exe/Wrapper.hs +++ b/exe/Wrapper.hs @@ -99,8 +99,10 @@ main = do Left err -> do T.hPutStrLn stderr (prettyError err NoShorten) case args of - Ghcide _ -> launchErrorLSP recorder (prettyError err Shorten) - _ -> pure () + Ghcide (GhcideArguments { argsCommand = Main.LSP }) -> + launchErrorLSP recorder (prettyError err Shorten) + + _ -> exitFailure launchHaskellLanguageServer :: Recorder (WithPriority (Doc ())) -> Arguments -> IO (Either WrapperSetupError ()) launchHaskellLanguageServer recorder parsedArgs = do From ab159c07c82da1b500fa06f356c88dc957d5442e Mon Sep 17 00:00:00 2001 From: Fendor Date: Fri, 1 Mar 2024 13:41:31 +0100 Subject: [PATCH 2/2] Install recommended GHC version for release wrapper tests --- .github/scripts/test.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/scripts/test.sh b/.github/scripts/test.sh index 396f185008..04cf680779 100644 --- a/.github/scripts/test.sh +++ b/.github/scripts/test.sh @@ -48,6 +48,8 @@ test_all_hls() { fi fi done + # install the recommended GHC version so the wrapper can launch HLS + ghcup install ghc --set recommended "$bindir/haskell-language-server-wrapper${ext}" typecheck "${test_module}" || fail "failed to typecheck with HLS wrapper" }