diff options
author | Ben Gamari <ben@smart-cactus.org> | 2018-02-20 00:26:45 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-02-20 13:15:40 -0500 |
commit | abfe10487d2dba49bf511297f14575f9089cc5b1 (patch) | |
tree | 7416a6fcd2091f9d92fc6740af07d5e37ee9e03d /utils/iserv/src | |
parent | f4336593a390e6317ac2852d8defb54bfa633d3e (diff) | |
download | haskell-abfe10487d2dba49bf511297f14575f9089cc5b1.tar.gz |
Revert "Move `iserv` into `utils` and change package name
See Phab:D4377 for the rationale. We will try this again.
This reverts commit 7c173b9043f7a9a5da46c5b0cc5fc3b38d1a7019.
Diffstat (limited to 'utils/iserv/src')
-rw-r--r-- | utils/iserv/src/Main.hs | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/utils/iserv/src/Main.hs b/utils/iserv/src/Main.hs deleted file mode 100644 index 858cee8e94..0000000000 --- a/utils/iserv/src/Main.hs +++ /dev/null @@ -1,63 +0,0 @@ -{-# LANGUAGE CPP, GADTs #-} - --- | --- The Remote GHCi server. --- --- For details on Remote GHCi, see Note [Remote GHCi] in --- compiler/ghci/GHCi.hs. --- -module Main (main) where - -import Lib (serv) - -import GHCi.Message -import GHCi.Signals -import GHCi.Utils - -import Control.Exception -import Control.Monad -import Data.IORef -import System.Environment -import System.Exit -import Text.Printf - -dieWithUsage :: IO a -dieWithUsage = do - prog <- getProgName - die $ prog ++ ": " ++ msg - where -#ifdef WINDOWS - msg = "usage: iserv <write-handle> <read-handle> [-v]" -#else - msg = "usage: iserv <write-fd> <read-fd> [-v]" -#endif - -main :: IO () -main = do - args <- getArgs - (wfd1, rfd2, rest) <- - case args of - arg0:arg1:rest -> do - let wfd1 = read arg0 - rfd2 = read arg1 - return (wfd1, rfd2, rest) - _ -> dieWithUsage - - verbose <- case rest of - ["-v"] -> return True - [] -> return False - _ -> dieWithUsage - when verbose $ - printf "GHC iserv starting (in: %d; out: %d)\n" - (fromIntegral rfd2 :: Int) (fromIntegral wfd1 :: Int) - inh <- getGhcHandle rfd2 - outh <- getGhcHandle wfd1 - installSignalHandlers - lo_ref <- newIORef Nothing - let pipe = Pipe{pipeRead = inh, pipeWrite = outh, pipeLeftovers = lo_ref} - uninterruptibleMask $ serv verbose hook pipe - - where hook = return -- empty hook - -- we cannot allow any async exceptions while communicating, because - -- we will lose sync in the protocol, hence uninterruptibleMask. - |