[commit: ghc] master: Enter iserv-proxy (d463107)
git at git.haskell.org
git at git.haskell.org
Tue Apr 11 02:19:51 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/d4631078ece3cfa4179c70f5937738be72659dba/ghc
>---------------------------------------------------------------
commit d4631078ece3cfa4179c70f5937738be72659dba
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date: Mon Apr 10 21:38:45 2017 -0400
Enter iserv-proxy
With the introduction of -fexternal-interpreter we are
now able to compile template haskell via an extern iserv process.
This however is restricted to the same host, and can therefore
not be used with crosscompilers where the iserv slave process
needs to run on a different machine than the cross compiling
haskell compiler.
This diff breaks up iserv into a library and the iserv-bin binary.
It also introduces the iserv-proxy, a proxy instance that the
haskell compiler can talk to, and which forwards the calls
to the iserv slave on a different machine, as well as providing
some extra functionarily (sending files that are not available
on the machine the slave runs on), as well as forwarding from
the slave to the haskell compiler, when the slave needs to
interrogate the haskell compiler.
The iserv library now also exports the startSlave function to be
called by the application that implements the slave on the target.
The simplest such app would probably look something like:
```
extern void startServ(bool, const char *);
int main(int argc, char * argv[]) {
hs_init(NULL, NULL);
startServ(false,"/tmp");
while(1);
}
```
Special thanks to Shea Levy for the first draft of the iserv-remote,
from which I took some inspiration.
The `Buildable` flags are due to ghc-cabal not being able to build
more than a single target. Please note that only the stock iserv-bin
is supposed to be built *with* ghc. The library and proxy are supposed
to be built outside of ghc. Yet I believe that this code should live
together with iserv.
Reviewers: simonmar, ezyang, goldfire, austin, rwbarton, bgamari
Reviewed By: simonmar
Subscribers: luite, ryantrinkle, shlevy, thomie
Differential Revision: https://phabricator.haskell.org/D3233
>---------------------------------------------------------------
d4631078ece3cfa4179c70f5937738be72659dba
iserv/iserv-bin.cabal | 113 ++++++++++++++++++-
iserv/proxy-src/Remote.hs | 255 ++++++++++++++++++++++++++++++++++++++++++
iserv/src/{Main.hs => Lib.hs} | 64 ++---------
iserv/src/Main.hs | 70 ++----------
iserv/src/Remote/Message.hs | 48 ++++++++
iserv/src/Remote/Slave.hs | 124 ++++++++++++++++++++
6 files changed, 552 insertions(+), 122 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc d4631078ece3cfa4179c70f5937738be72659dba
More information about the ghc-commits
mailing list