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 | |
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')
-rw-r--r-- | utils/iserv/Makefile | 15 | ||||
-rw-r--r-- | utils/iserv/cbits/iservmain.c | 17 | ||||
-rw-r--r-- | utils/iserv/ghc.mk | 113 | ||||
-rw-r--r-- | utils/iserv/iserv.cabal | 44 | ||||
-rw-r--r-- | utils/iserv/src/Main.hs | 63 |
5 files changed, 0 insertions, 252 deletions
diff --git a/utils/iserv/Makefile b/utils/iserv/Makefile deleted file mode 100644 index 361985852f..0000000000 --- a/utils/iserv/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# ----------------------------------------------------------------------------- -# -# (c) 2009 The University of Glasgow -# -# This file is part of the GHC build system. -# -# To understand how the build system works and how to modify it, see -# http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture -# http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying -# -# ----------------------------------------------------------------------------- - -dir = utils/iserv -TOP = ../.. -include $(TOP)/mk/sub-makefile.mk diff --git a/utils/iserv/cbits/iservmain.c b/utils/iserv/cbits/iservmain.c deleted file mode 100644 index daefd35251..0000000000 --- a/utils/iserv/cbits/iservmain.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "../rts/PosixSource.h" -#include "Rts.h" - -#include "HsFFI.h" - -int main (int argc, char *argv[]) -{ - RtsConfig conf = defaultRtsConfig; - - // We never know what symbols GHC will look up in the future, so - // we must retain CAFs for running interpreted code. - conf.keep_cafs = 1; - - conf.rts_opts_enabled = RtsOptsAll; - extern StgClosure ZCMain_main_closure; - hs_main(argc, argv, &ZCMain_main_closure, conf); -} diff --git a/utils/iserv/ghc.mk b/utils/iserv/ghc.mk deleted file mode 100644 index 194621a85c..0000000000 --- a/utils/iserv/ghc.mk +++ /dev/null @@ -1,113 +0,0 @@ -# ----------------------------------------------------------------------------- -# -# (c) 2009-2012 The University of Glasgow -# -# This file is part of the GHC build system. -# -# To understand how the build system works and how to modify it, see -# http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture -# http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying -# -# ----------------------------------------------------------------------------- - -utils/iserv_USES_CABAL = YES -utils/iserv_PACKAGE = iserv -utils/iserv_EXECUTABLE = iserv - -ifeq "$(GhcDebugged)" "YES" -utils/iserv_stage2_MORE_HC_OPTS += -debug -utils/iserv_stage2_p_MORE_HC_OPTS += -debug -utils/iserv_stage2_dyn_MORE_HC_OPTS += -debug -endif - -ifeq "$(GhcThreaded)" "YES" -utils/iserv_stage2_MORE_HC_OPTS += -threaded -utils/iserv_stage2_p_MORE_HC_OPTS += -threaded -utils/iserv_stage2_dyn_MORE_HC_OPTS += -threaded -endif - -# Add -Wl,--export-dynamic enables GHCi to load dynamic objects that -# refer to the RTS. This is harmless if you don't use it (adds a bit -# of overhead to startup and increases the binary sizes) but if you -# need it there's no alternative. -ifeq "$(TargetElf)" "YES" -ifneq "$(TargetOS_CPP)" "solaris2" -# The Solaris linker does not support --export-dynamic option. It also -# does not need it since it exports all dynamic symbols by default -utils/iserv_stage2_MORE_HC_OPTS += -optl-Wl,--export-dynamic -utils/iserv_stage2_p_MORE_HC_OPTS += -optl-Wl,--export-dynamic -utils/iserv_stage2_dyn_MORE_HC_OPTS += -optl-Wl,--export-dynamic -endif -endif - -# Override the default way, because we want a specific version of this -# program for each way. Note that it's important to do this even for -# the vanilla version, otherwise we get a dynamic executable when -# DYNAMIC_GHC_PROGRAMS=YES. -utils/iserv_stage2_PROGRAM_WAY = v -utils/iserv_stage2_p_PROGRAM_WAY = p -utils/iserv_stage2_dyn_PROGRAM_WAY = dyn - -utils/iserv_stage2_PROGNAME = ghc-iserv -utils/iserv_stage2_p_PROGNAME = ghc-iserv-prof -utils/iserv_stage2_dyn_PROGNAME = ghc-iserv-dyn - -utils/iserv_stage2_MORE_HC_OPTS += -no-hs-main -utils/iserv_stage2_p_MORE_HC_OPTS += -no-hs-main -utils/iserv_stage2_dyn_MORE_HC_OPTS += -no-hs-main - -utils/iserv_stage2_INSTALL = YES -utils/iserv_stage2_p_INSTALL = YES -utils/iserv_stage2_dyn_INSTALL = YES - -# Install in $(libexec), not in $(bindir) -utils/iserv_stage2_TOPDIR = YES -utils/iserv_stage2_p_TOPDIR = YES -utils/iserv_stage2_dyn_TOPDIR = YES - -utils/iserv_stage2_INSTALL_INPLACE = YES -utils/iserv_stage2_p_INSTALL_INPLACE = YES -utils/iserv_stage2_dyn_INSTALL_INPLACE = YES - -ifeq "$(CLEANING)" "YES" - -NEED_iserv = YES -NEED_iserv_p = YES -NEED_iserv_dyn = YES - -else - -ifneq "$(findstring v, $(GhcLibWays))" "" -NEED_iserv = YES -else -NEED_iserv = NO -endif - -ifneq "$(findstring p, $(GhcLibWays))" "" -NEED_iserv_p = YES -else -NEED_iserv_p = NO -endif - -ifneq "$(findstring dyn, $(GhcLibWays))" "" -NEED_iserv_dyn = YES -else -NEED_iserv_dyn = NO -endif -endif - -ifeq "$(NEED_iserv)" "YES" -$(eval $(call build-prog,utils/iserv,stage2,1)) -endif - -ifeq "$(NEED_iserv_p)" "YES" -$(eval $(call build-prog,utils/iserv,stage2_p,1)) -endif - -ifeq "$(NEED_iserv_dyn)" "YES" -$(eval $(call build-prog,utils/iserv,stage2_dyn,1)) -endif - -all_ghc_stage2 : $(iserv-stage2_INPLACE) -all_ghc_stage2 : $(iserv-stage2_p_INPLACE) -all_ghc_stage2 : $(iserv-stage2_dyn_INPLACE) diff --git a/utils/iserv/iserv.cabal b/utils/iserv/iserv.cabal deleted file mode 100644 index 4d1a6b61b1..0000000000 --- a/utils/iserv/iserv.cabal +++ /dev/null @@ -1,44 +0,0 @@ -Name: iserv -Version: 8.5 -Copyright: XXX -License: BSD3 --- XXX License-File: LICENSE -Author: XXX -Maintainer: XXX -Synopsis: iserv allows GHC to delegate Tempalte Haskell computations -Description: - GHC can be provided with a path to the iserv binary with - @-pgmi=/path/to/iserv-bin@, and will in combination with - @-fexternal-interpreter@, compile Template Haskell though the - @iserv-bin@ delegate. This is very similar to how ghcjs has been - compiling Template Haskell, by spawning a separate delegate (so - called runner on the javascript vm) and evaluating the splices - there. - . - To use iserv with cross compilers, please see @libraries/libiserv@ - and @utils/iserv-proxy@. - -Category: Development -build-type: Simple -cabal-version: >=1.10 - -Executable iserv - Default-Language: Haskell2010 - ghc-options: -no-hs-main - Main-Is: Main.hs - C-Sources: cbits/iservmain.c - Hs-Source-Dirs: src - include-dirs: . - Build-Depends: array >= 0.5 && < 0.6, - base >= 4 && < 5, - binary >= 0.7 && < 0.9, - bytestring >= 0.10 && < 0.11, - containers >= 0.5 && < 0.6, - deepseq >= 1.4 && < 1.5, - ghci == 8.5.*, - libiserv == 8.5 - - if os(windows) - Cpp-Options: -DWINDOWS - else - Build-Depends: unix >= 2.7 && < 2.8 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. - |