[Git][ghc/ghc][wip/romes/async-rpc] nvm: sendMessage doesn't shutdown interp. if you want to, catch RemoteCallFailed
Rodrigo Mesquita pushed to branch wip/romes/async-rpc at Glasgow Haskell Compiler / GHC Commits: fd8c7167 by Rodrigo Mesquita at 2026-10-09T15:14:49+01:00 nvm: sendMessage doesn't shutdown interp. if you want to, catch RemoteCallFailed - - - - - 1 changed file: - compiler/GHC/Runtime/Interpreter/Process.hs Changes: ===================================== compiler/GHC/Runtime/Interpreter/Process.hs ===================================== @@ -3,6 +3,7 @@ module GHC.Runtime.Interpreter.Process -- * Message API Message(..) , sendMessage + , RemoteCallFailed(..) ) where @@ -18,12 +19,14 @@ import GHC.Utils.Exception as Ex import Data.Binary import System.Exit import System.Process -import Data.Bifunctor -- ----------------------------------------------------------------------------- -- Top-level Message API -- | Send a message to the interpreter and expect a response, blocking until it arrives. +-- +-- Throws 'RemoteCallFailed' if the remote call threw an exception in the +-- external interpreter sendMessage :: Binary a => ExtInterpInstance d -> Message a -> IO a sendMessage i msg = unwrapRight =<< remoteCall (interpPipe proc) msg @@ -33,10 +36,7 @@ sendMessage i msg = unwrapRight =<< unwrapRight :: Either SomeException b -> IO b unwrapRight (Right a) = pure a unwrapRight (Left er) = do - let ex = RemoteCallFailed er - unwrapRight . bimap (addExceptionContext (WhileHandling (SomeException ex))) id - =<< remoteCall (interpPipe proc) Shutdown - throwIO ex + throwIO (RemoteCallFailed er) handleInterpProcessFailure :: InterpProcess -> SomeException -> IO a handleInterpProcessFailure i e = do View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fd8c71678c0c21afe375bcec6e63e420... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fd8c71678c0c21afe375bcec6e63e420... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Rodrigo Mesquita (@alt-romes)