on iko/ghcjs-patch-master help sign in
Cleanup iserv patches (#439)

This commit cleans up iserv-related patches, especially for GHC 8.4, by making sure they are exactly changes made upstream (only with merge conflicts resolved). Overall, there are three groups of patches now: 1. move-iserv is merely an upstream change that was merged between 8.4 and 8.6. The previous patch was probably some development version, now it is the same as upstream. 2. iserv-autoconf was merged upstream between 8.6 and 8.8. The patch consists entirely of replacing version numbers with variables, therefore applying the same patch to 8.4 and 8.6 causes conflicts, so we have two versions of the same patch for simplicity. Additionally, the 8.6 is different from the upstream one in that it does not remove the .cabal files, see the commit description in the patch for details. 3. iserv-cleanup was merged between 8.8 and 8.10. It applies cleanly to 8.8 and 8.6, however there is conflict in one line when applying it to 8.4. As a workaround, when applying this patch to 8.4 we first prepare the source to avoid the conflict, and then undo this change. This allows us to use the same main patch for 8.4 as for 8.6 and 8.8. Also, in all patches changes to .gitignore were manually removed, as this file does not exist in the Nix checkout of src and this causes the patches to fail.

commitf754c5bf4e11eb08238bbeebee146fca3a7a0c88 authorKirill Elagin <kirelagin@gmail.com> dateMon 10 Feb 2020, 20:32 (7 years ago) parent29e42da
7 files changed+678−313
overlays/bootstrap.nix+6−4 overlays/patches/ghc/iserv-autoconf-8.4.1.patch+152 overlays/patches/ghc/iserv-proxy-cleanup.patch → overlays/patches/ghc/iserv-autoconf-8.6.1.patch+73−88 overlays/patches/ghc/iserv-cleanup-8.8.1-prepare-8.4.1.patch+31 overlays/patches/ghc/iserv-proxy-cleanup-3.patch → overlays/patches/ghc/iserv-cleanup-8.8.1-revert-8.4.1.patch+17−4 overlays/patches/ghc/iserv-proxy-cleanup-2.patch → overlays/patches/ghc/iserv-cleanup-8.8.1.patch+313−56 overlays/patches/ghc/move-iserv-8.4.2.patch → overlays/patches/ghc/iserv-move-8.4.1.patch+86−161
overlays/bootstrap.nix+6−4
@@ -68,7 +68,7 @@ in {
6868 # will be applied to most versions of the GHC anyway (reordering the patches
6969 # results in rebuilds of GHC and reduces sharing in /nix/store).
7070 in fromUntil "8.4.4" "8.6" ./patches/ghc/ghc-8.4.4-reinstallable-lib-ghc.patch
71− ++ until "8.6" ./patches/ghc/move-iserv-8.4.2.patch
71+ ++ until "8.6" ./patches/ghc/iserv-move-8.4.1.patch # 6fbe5f274ba84181f5db50901639ae382ef68c4b -- merged; ghc-8.6.1
7272 ++ until "8.6" ./patches/ghc/hsc2hs-8.4.2.patch
7373 ++ until "8.6" ./patches/ghc/various-8.4.2.patch
7474 ++ until "8.6" ./patches/ghc/lowercase-8.4.2.patch
@@ -77,9 +77,11 @@ in {
7777 ++ until "8.6" ./patches/ghc/outputtable-assert-8.4.patch
7878 ++ fromUntil "8.6" "8.6.4" ./patches/ghc/MR148--T16104-GhcPlugins.patch
7979 ++ until "8.6.4" ./patches/ghc/MR95--ghc-pkg-deadlock-fix.patch
80− ++ fromUntil "8.6" "8.8" ./patches/ghc/iserv-proxy-cleanup.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/250 -- merged; ghc-8.8.1
81− ++ from "8.6" ./patches/ghc/iserv-proxy-cleanup-2.patch
82− ++ from "8.8" ./patches/ghc/iserv-proxy-cleanup-3.patch
80+ ++ fromUntil "8.4" "8.6" ./patches/ghc/iserv-autoconf-8.4.1.patch # (same as below, but based on 8.4)
81+ ++ fromUntil "8.6" "8.8" ./patches/ghc/iserv-autoconf-8.6.1.patch # 8f9f52d8e421ce544d5437a93117545d52d0eabd -- merged; ghc-8.8.1
82+ ++ fromUntil "8.4" "8.6" ./patches/ghc/iserv-cleanup-8.8.1-prepare-8.4.1.patch # (prepare for below; see patch for details)
83+ ++ until "8.10" ./patches/ghc/iserv-cleanup-8.8.1.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/250 -- merged; ghc-8.10.1
84+ ++ fromUntil "8.4" "8.6" ./patches/ghc/iserv-cleanup-8.8.1-revert-8.4.1.patch # (revert prepare)
8385 ++ fromUntil "8.2" "8.8" ./patches/ghc/MR545--ghc-pkg-databases.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/545 -- merged; ghc-8.8.1
8486 ++ fromUntil "8.6" "8.8" ./patches/ghc/outputtable-assert-8.6.patch
8587 ++ fromUntil "8.6.4" "8.8" ./patches/ghc/ghc-8.6.4-reenable-th-qq-in-stage1.patch
overlays/patches/ghc/iserv-autoconf-8.4.1.patchnew file+152
@@ -0,0 +1,152 @@
1+From 14c09e8eca430cc0dea2c23d4ef0f399b3a52626 Mon Sep 17 00:00:00 2001
2+From: Ryan Scott <ryan.gl.scott@gmail.com>
3+Date: Mon, 26 Nov 2018 12:59:30 -0500
4+Subject: [PATCH] Use autoconf to generate version numbers for libiserv and
5+ friends
6+
7+Summary:
8+Currently, the version numbers for `libiserv`, `iserv`, and
9+`iserv-proxy` are hard-coded directly into their `.cabal` files.
10+These are easy to forget to update, and in fact, this has already
11+happened once (see #15866). Let's use `autoconf` to do this for us
12+so that it is not forgotten in the future.
13+
14+Test Plan: ./validate
15+
16+Reviewers: bgamari
17+
18+Reviewed By: bgamari
19+
20+Subscribers: rwbarton, erikd, carter
21+
22+GHC Trac Issues: #15866
23+
24+Differential Revision: https://phabricator.haskell.org/D5302
25+---
26+ .gitignore | 3 +++
27+ configure.ac | 2 +-
28+ .../libiserv/{libiserv.cabal => libiserv.cabal.in} | 8 ++++++--
29+ .../{iserv-proxy.cabal => iserv-proxy.cabal.in} | 8 ++++++--
30+ utils/iserv/{iserv.cabal => iserv.cabal.in} | 10 +++++++---
31+ 5 files changed, 23 insertions(+), 8 deletions(-)
32+ rename libraries/libiserv/{libiserv.cabal => libiserv.cabal.in} (80%)
33+ rename utils/iserv-proxy/{iserv-proxy.cabal => iserv-proxy.cabal.in} (91%)
34+ rename utils/iserv/{iserv.cabal => iserv.cabal.in} (81%)
35+
36+diff --git a/.gitignore b/.gitignore
37+index 0d3a3a24d8..f4f8529f0a 100644
38+--- a/.gitignore
39++++ b/.gitignore
40+@@ -148,6 +148,7 @@ _darcs/
41+ /libraries/hslogo-16.png
42+ /libraries/index-frames.html
43+ /libraries/index.html
44++/libraries/libiserv/libiserv.cabal
45+ /libraries/minus.gif
46+ /libraries/ocean.css
47+ /libraries/plus.gif
48+@@ -173,6 +174,8 @@ _darcs/
49+ /testsuite_summary*.txt
50+ /testsuite*.xml
51+ /testlog*
52++/utils/iserv/iserv.cabal
53++/utils/iserv-proxy/iserv-proxy.cabal
54+ /utils/mkUserGuidePart/mkUserGuidePart.cabal
55+ /utils/runghc/runghc.cabal
56+ /utils/gen-dll/gen-dll.cabal
57+diff --git a/configure.ac b/configure.ac
58+index 30241a5734..a5d2026434 100644
59+--- a/configure.ac
60++++ b/configure.ac
61+@@ -1298,7 +1298,7 @@ checkMake380() {
62+ checkMake380 make
63+ checkMake380 gmake
64+
65+-AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
66++AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
67+ AC_OUTPUT
68+ [
69+ if test "$print_make_warning" = "true"; then
70+diff --git a/libraries/libiserv/libiserv.cabal b/libraries/libiserv/libiserv.cabal.in
71+similarity index 80%
72+rename from libraries/libiserv/libiserv.cabal
73+rename to libraries/libiserv/libiserv.cabal.in
74+index 43f1180073..386f26c034 100644
75+--- a/libraries/libiserv/libiserv.cabal
76++++ b/libraries/libiserv/libiserv.cabal.in
77+@@ -1,5 +1,9 @@
78++-- WARNING: libiserv.cabal is automatically generated from libiserv.cabal.in by
79++-- ../../configure. Make sure you are editing libiserv.cabal.in, not
80++-- libiserv.cabal.
81++
82+ Name: libiserv
83+-Version: 8.4
84++Version: @ProjectVersionMunged@
85+ Copyright: XXX
86+ License: BSD3
87+ -- XXX License-File: LICENSE
88+@@ -25,7 +29,7 @@ Library
89+ bytestring >= 0.10 && < 0.11,
90+ containers >= 0.5 && < 0.6,
91+ deepseq >= 1.4 && < 1.5,
92+- ghci == 8.4.*
93++ ghci == @ProjectVersionMunged@
94+ if flag(network)
95+ Exposed-Modules: Remote.Message
96+ , Remote.Slave
97+diff --git a/utils/iserv-proxy/iserv-proxy.cabal b/utils/iserv-proxy/iserv-proxy.cabal.in
98+similarity index 91%
99+rename from utils/iserv-proxy/iserv-proxy.cabal
100+rename to utils/iserv-proxy/iserv-proxy.cabal.in
101+index fa25c77794..2da65ae556 100644
102+--- a/utils/iserv-proxy/iserv-proxy.cabal
103++++ b/utils/iserv-proxy/iserv-proxy.cabal.in
104+@@ -1,5 +1,9 @@
105++-- WARNING: iserv-proxy.cabal is automatically generated from iserv-proxy.cabal.in by
106++-- ../../configure. Make sure you are editing iserv-proxy.cabal.in, not
107++-- iserv-proxy.cabal.
108++
109+ Name: iserv-proxy
110+-Version: 8.4
111++Version: @ProjectVersion@
112+ Copyright: XXX
113+ License: BSD3
114+ -- XXX License-File: LICENSE
115+@@ -75,4 +79,4 @@ Executable iserv-proxy
116+ directory >= 1.3 && < 1.4,
117+ network >= 2.6,
118+ filepath >= 1.4 && < 1.5,
119+- libiserv == 8.4
120++ libiserv == @ProjectVersionMunged@
121+diff --git a/utils/iserv/iserv.cabal b/utils/iserv/iserv.cabal.in
122+similarity index 81%
123+rename from utils/iserv/iserv.cabal
124+rename to utils/iserv/iserv.cabal.in
125+index 768c0e0f83..d4234d4621 100644
126+--- a/utils/iserv/iserv.cabal
127++++ b/utils/iserv/iserv.cabal.in
128+@@ -1,5 +1,9 @@
129++-- WARNING: iserv.cabal is automatically generated from iserv.cabal.in by
130++-- ../../configure. Make sure you are editing iserv.cabal.in, not
131++-- iserv.cabal.
132++
133+ Name: iserv
134+-Version: 8.4
135++Version: @ProjectVersion@
136+ Copyright: XXX
137+ License: BSD3
138+ -- XXX License-File: LICENSE
139+@@ -35,8 +39,8 @@ Executable iserv
140+ bytestring >= 0.10 && < 0.11,
141+ containers >= 0.5 && < 0.6,
142+ deepseq >= 1.4 && < 1.5,
143+- ghci == 8.4.*,
144+- libiserv == 8.4
145++ ghci == @ProjectVersionMunged@,
146++ libiserv == @ProjectVersionMunged@
147+
148+ if os(windows)
149+ Cpp-Options: -DWINDOWS
150+--
151+2.24.1
152+
overlays/patches/ghc/iserv-proxy-cleanup.patch → overlays/patches/ghc/iserv-autoconf-8.6.1.patchrenamed+73−88
@@ -1,5 +1,71 @@
1+From c994c306f2e2f0ebcd8141c2c580ee7ed464cb7d Mon Sep 17 00:00:00 2001
2+From: Kirill Elagin <kirelagin@gmail.com>
3+Date: Thu, 6 Feb 2020 21:54:03 -0500
4+Subject: [PATCH] Use autoconf to generate version numbers for libiserv and
5+ friends
6+
7+kirelagin: This is the upstream commit modified not to remove original
8+.cabal files. Before this change those files contained GHC versions and
9+this caused conflicts when trying to apply the same patch to different
10+versions of GHC. In this form the patch can be cleanly applied to any
11+minor version of GHC 8.6.
12+
13+Original commit description follows.
14+
15+---
16+
17+Summary:
18+Currently, the version numbers for `libiserv`, `iserv`, and
19+`iserv-proxy` are hard-coded directly into their `.cabal` files.
20+These are easy to forget to update, and in fact, this has already
21+happened once (see #15866). Let's use `autoconf` to do this for us
22+so that it is not forgotten in the future.
23+
24+Test Plan: ./validate
25+
26+Reviewers: bgamari
27+
28+Reviewed By: bgamari
29+
30+Subscribers: rwbarton, erikd, carter
31+
32+GHC Trac Issues: #15866
33+
34+Differential Revision: https://phabricator.haskell.org/D5302
35+---
36+ .gitignore | 3 +
37+ configure.ac | 2 +-
38+ libraries/libiserv/libiserv.cabal.in | 43 ++++++++++++++
39+ utils/iserv-proxy/iserv-proxy.cabal.in | 82 ++++++++++++++++++++++++++
40+ utils/iserv/iserv.cabal.in | 48 +++++++++++++++
41+ 5 files changed, 177 insertions(+), 1 deletion(-)
42+ create mode 100644 libraries/libiserv/libiserv.cabal.in
43+ create mode 100644 utils/iserv-proxy/iserv-proxy.cabal.in
44+ create mode 100644 utils/iserv/iserv.cabal.in
45+
46+diff --git a/.gitignore b/.gitignore
47+index 7e2425c964..da0254f26a 100644
48+--- a/.gitignore
49++++ b/.gitignore
50+@@ -153,6 +153,7 @@ _darcs/
51+ /libraries/hslogo-16.png
52+ /libraries/index-frames.html
53+ /libraries/index.html
54++/libraries/libiserv/libiserv.cabal
55+ /libraries/minus.gif
56+ /libraries/ocean.css
57+ /libraries/plus.gif
58+@@ -178,6 +179,8 @@ _darcs/
59+ /testsuite_summary*.txt
60+ /testsuite*.xml
61+ /testlog*
62++/utils/iserv/iserv.cabal
63++/utils/iserv-proxy/iserv-proxy.cabal
64+ /utils/mkUserGuidePart/mkUserGuidePart.cabal
65+ /utils/runghc/runghc.cabal
66+ /utils/gen-dll/gen-dll.cabal
167diff --git a/configure.ac b/configure.ac
2−index 846924727d..0e67c1051a 100644
68+index 5fd3441563..d7d8d192a9 100644
369--- a/configure.ac
470+++ b/configure.ac
571@@ -1334,7 +1334,7 @@ checkMake380() {
@@ -7,7 +73,7 @@ index 846924727d..0e67c1051a 100644
773 checkMake380 gmake
874
975-AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/ghc-heap/ghc-heap.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
10−+AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/remote-iserv/remote-iserv.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/ghc-heap/ghc-heap.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
76++AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/ghc-heap/ghc-heap.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
1177 AC_OUTPUT
1278 [
1379 if test "$print_make_warning" = "true"; then
@@ -60,90 +126,6 @@ index 0000000000..31eaaeb838
60126+ Cpp-Options: -DWINDOWS
61127+ else
62128+ Build-Depends: unix >= 2.7 && < 2.9
63−diff --git a/utils/iserv-proxy/iserv-proxy.cabal b/utils/iserv-proxy/iserv-proxy.cabal
64−deleted file mode 100644
65−index 5d276b244d..0000000000
66−--- a/utils/iserv-proxy/iserv-proxy.cabal
67−+++ /dev/null
68−@@ -1,78 +0,0 @@
69−-Name: iserv-proxy
70−-Version: 8.6
71−-Copyright: XXX
72−-License: BSD3
73−--- XXX License-File: LICENSE
74−-Author: XXX
75−-Maintainer: XXX
76−-Synopsis: iserv allows GHC to delegate Tempalte Haskell computations
77−-Description:
78−- GHC can be provided with a path to the iserv binary with
79−- @-pgmi=/path/to/iserv-bin@, and will in combination with
80−- @-fexternal-interpreter@, compile Template Haskell though the
81−- @iserv-bin@ delegate. This is very similar to how ghcjs has been
82−- compiling Template Haskell, by spawning a separate delegate (so
83−- called runner on the javascript vm) and evaluating the splices
84−- there.
85−- .
86−- iserv can also be used in combination with cross compilation. For
87−- this, the @iserv-proxy@ needs to be built on the host, targeting the
88−- host (as it is running on the host). @cabal install -flibrary
89−- -fproxy@ will yield the proxy.
90−- .
91−- Using the cabal for the target @arch-platform-target-cabal install
92−- -flibrary@ will build the required library that contains the ffi
93−- @startSlave@ function, which needs to be invoked on the target
94−- (e.g. in an iOS application) to start the remote iserv slave.
95−- .
96−- calling the GHC cross compiler with @-fexternal-interpreter
97−- -pgmi=$HOME/.cabal/bin/iserv-proxy -opti\<ip address\> -opti\<port\>@
98−- will cause it to compile Template Haskell via the remote at \<ip address\>.
99−- .
100−- Thus to get cross compilation with Template Haskell follow the
101−- following receipt:
102−- .
103−- * compile the iserv library for your target
104−- .
105−- > iserv $ arch-platform-target-cabal install -flibrary
106−- .
107−- * setup an application for your target that calls the
108−- * startSlave function. This could be either haskell or your
109−- * targets ffi capable language, if needed.
110−- .
111−- > void startSlave(false /* verbose */, 5000 /* port */,
112−- > "/path/to/storagelocation/on/target");
113−- .
114−- * build the iserv-proxy
115−- .
116−- > iserv $ cabal install -flibrary -fproxy
117−- * Start your iserv-slave app on your target running on say @10.0.0.1:5000@
118−- * compiler your sources with -fexternal-interpreter and the proxy
119−- .
120−- > project $ arch-platform-target-ghc ModuleContainingTH.hs \
121−- > -fexternal-interpreter \
122−- > -pgmi=$HOME/.cabal/bin/iserv-proxy \
123−- > -opti10.0.0.1 -opti5000
124−- .
125−- Should something not work as expected, provide @-opti-v@ for verbose
126−- logging of the @iserv-proxy@.
127−-
128−-Category: Development
129−-build-type: Simple
130−-cabal-version: >=1.10
131−-
132−-Executable iserv-proxy
133−- Default-Language: Haskell2010
134−- Main-Is: Main.hs
135−- Hs-Source-Dirs: src
136−- Build-Depends: array >= 0.5 && < 0.6,
137−- base >= 4 && < 5,
138−- binary >= 0.7 && < 0.9,
139−- bytestring >= 0.10 && < 0.11,
140−- containers >= 0.5 && < 0.6,
141−- deepseq >= 1.4 && < 1.5,
142−- directory >= 1.3 && < 1.4,
143−- network >= 2.6,
144−- filepath >= 1.4 && < 1.5,
145−- ghci == 8.6.*,
146−- libiserv == 8.6.*
147129diff --git a/utils/iserv-proxy/iserv-proxy.cabal.in b/utils/iserv-proxy/iserv-proxy.cabal.in
148130new file mode 100644
149131index 0000000000..0819064601
@@ -234,7 +216,7 @@ index 0000000000..0819064601
234216+ libiserv == @ProjectVersionMunged@
235217diff --git a/utils/iserv/iserv.cabal.in b/utils/iserv/iserv.cabal.in
236218new file mode 100644
237−index 0000000000..356c8a444a
219+index 0000000000..bcb3be75a0
238220--- /dev/null
239221+++ b/utils/iserv/iserv.cabal.in
240222@@ -0,0 +1,48 @@
@@ -249,7 +231,7 @@ index 0000000000..356c8a444a
249231+-- XXX License-File: LICENSE
250232+Author: XXX
251233+Maintainer: XXX
252−+Synopsis: iserv allows GHC to delegate Template Haskell computations
234++Synopsis: iserv allows GHC to delegate Tempalte Haskell computations
253235+Description:
254236+ GHC can be provided with a path to the iserv binary with
255237+ @-pgmi=/path/to/iserv-bin@, and will in combination with
@@ -286,3 +268,6 @@ index 0000000000..356c8a444a
286268+ Cpp-Options: -DWINDOWS
287269+ else
288270+ Build-Depends: unix >= 2.7 && < 2.9
271+--
272+2.24.1
273+
overlays/patches/ghc/iserv-cleanup-8.8.1-prepare-8.4.1.patchnew file+31
@@ -0,0 +1,31 @@
1+From b362ab9a2c9fc35f9089010f1aaa2e8c96571584 Mon Sep 17 00:00:00 2001
2+From: Kirill Elagin <kirelagin@gmail.com>
3+Date: Thu, 6 Feb 2020 14:33:39 -0500
4+Subject: [PATCH] GHC 8.4 prepare for GHC 8.6 patch
5+
6+The long AC_CONFIG_FILES line was changed upstream between 8.4.1 and
7+8.6.1, so causes a conflict when applying the same iserv-cleanup patch.
8+
9+Instead of having two different patches, we first prepare 8.4 by making
10+the line the same as in 8.6, then apply the 8.6 patch, then revert the
11+first change.
12+---
13+ configure.ac | 2 +-
14+ 1 file changed, 1 insertion(+), 1 deletion(-)
15+
16+diff --git a/configure.ac b/configure.ac
17+index a5d2026434..756b60e74f 100644
18+--- a/configure.ac
19++++ b/configure.ac
20+@@ -1298,7 +1298,7 @@ checkMake380() {
21+ checkMake380 make
22+ checkMake380 gmake
23+
24+-AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
25++AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/ghc-heap/ghc-heap.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
26+ AC_OUTPUT
27+ [
28+ if test "$print_make_warning" = "true"; then
29+--
30+2.24.1
31+
overlays/patches/ghc/iserv-proxy-cleanup-3.patch → overlays/patches/ghc/iserv-cleanup-8.8.1-revert-8.4.1.patchrenamed+17−4
@@ -1,13 +1,26 @@
1+From 8fefb7e1efb321f963e9f89cee7a5af891805a91 Mon Sep 17 00:00:00 2001
2+From: Kirill Elagin <kirelagin@gmail.com>
3+Date: Thu, 6 Feb 2020 14:38:32 -0500
4+Subject: [PATCH] Revert "GHC 8.4 prepare for GHC 8.6 patch"
5+
6+This reverts commit b362ab9a2c9fc35f9089010f1aaa2e8c96571584.
7+---
8+ configure.ac | 2 +-
9+ 1 file changed, 1 insertion(+), 1 deletion(-)
10+
111diff --git a/configure.ac b/configure.ac
2−index 846924727d..0e67c1051a 100644
12+index 0e7bd86cdd..8165173fc7 100644
313--- a/configure.ac
414+++ b/configure.ac
5−@@ -1338,7 +1338,7 @@ checkMake380() {
15+@@ -1298,7 +1298,7 @@ checkMake380() {
616 checkMake380 make
717 checkMake380 gmake
818
9−-AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/ghc-heap/ghc-heap.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
10−+AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/remote-iserv/remote-iserv.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/ghc-heap/ghc-heap.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
19+-AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/remote-iserv/remote-iserv.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/ghc-heap/ghc-heap.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
20++AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/remote-iserv/remote-iserv.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
1121 AC_OUTPUT
1222 [
1323 if test "$print_make_warning" = "true"; then
24+--
25+2.24.1
26+
overlays/patches/ghc/iserv-proxy-cleanup-2.patch → overlays/patches/ghc/iserv-cleanup-8.8.1.patchrenamed+313−56
@@ -1,5 +1,87 @@
1+From a6edc06e205848ea1e15456b24238e0f7cb001cd Mon Sep 17 00:00:00 2001
2+From: Moritz Angermann <moritz.angermann@gmail.com>
3+Date: Wed, 30 Jan 2019 09:47:20 +0800
4+Subject: [PATCH] Cleanup iserv/iserv-proxy
5+
6+This adds trace messages that include the processes name and as such
7+make debugging and following the communication easier.
8+
9+It also adds a note regarding the fwd*Call proxy-communication logic
10+between the proxy and the slave.
11+
12+The proxy will now also poll for 60s to wait for the remote iserv
13+to come up. (Alternatively you can start the remote process
14+beforehand; and just have iserv-proxy connect to it)
15+---
16+ .gitignore | 1 +
17+ configure.ac | 2 +-
18+ docs/users_guide/ghci.rst | 32 +++++
19+ libraries/libiserv/libiserv.cabal.in | 2 +-
20+ libraries/libiserv/proxy-src/Remote.hs | 3 +-
21+ libraries/libiserv/src/Lib.hs | 23 +++-
22+ libraries/libiserv/src/Remote/Slave.hs | 24 ++--
23+ testsuite/tests/iserv-remote/Lib.hs | 7 ++
24+ testsuite/tests/iserv-remote/Main.hs | 5 +
25+ testsuite/tests/iserv-remote/Makefile | 38 ++++++
26+ testsuite/tests/iserv-remote/Setup.hs | 2 +
27+ testsuite/tests/iserv-remote/all.T | 11 ++
28+ .../tests/iserv-remote/iserv-remote.stderr | 1 +
29+ .../tests/iserv-remote/iserv-remote.stdout | 1 +
30+ testsuite/tests/iserv-remote/iserv-wrapper | 12 ++
31+ .../tests/iserv-remote/remote-iserv.stderr | 2 +
32+ .../tests/iserv-remote/remote-iserv.stdout | 4 +
33+ utils/iserv-proxy/Makefile | 4 +-
34+ utils/iserv-proxy/iserv-proxy.cabal.in | 2 +-
35+ utils/iserv-proxy/src/Main.hs | 89 ++++++++++----
36+ utils/remote-iserv/Makefile | 15 +++
37+ utils/remote-iserv/Setup.hs | 2 +
38+ utils/remote-iserv/ghc.mk | 113 ++++++++++++++++++
39+ utils/remote-iserv/remote-iserv.cabal.in | 27 +++++
40+ utils/remote-iserv/src/Cli.hs | 30 +++++
41+ 25 files changed, 415 insertions(+), 37 deletions(-)
42+ create mode 100644 testsuite/tests/iserv-remote/Lib.hs
43+ create mode 100644 testsuite/tests/iserv-remote/Main.hs
44+ create mode 100644 testsuite/tests/iserv-remote/Makefile
45+ create mode 100644 testsuite/tests/iserv-remote/Setup.hs
46+ create mode 100644 testsuite/tests/iserv-remote/all.T
47+ create mode 100644 testsuite/tests/iserv-remote/iserv-remote.stderr
48+ create mode 100644 testsuite/tests/iserv-remote/iserv-remote.stdout
49+ create mode 100755 testsuite/tests/iserv-remote/iserv-wrapper
50+ create mode 100644 testsuite/tests/iserv-remote/remote-iserv.stderr
51+ create mode 100644 testsuite/tests/iserv-remote/remote-iserv.stdout
52+ create mode 100644 utils/remote-iserv/Makefile
53+ create mode 100644 utils/remote-iserv/Setup.hs
54+ create mode 100644 utils/remote-iserv/ghc.mk
55+ create mode 100644 utils/remote-iserv/remote-iserv.cabal.in
56+ create mode 100644 utils/remote-iserv/src/Cli.hs
57+
58+diff --git a/.gitignore b/.gitignore
59+index b205b2441e..453f7e3ada 100644
60+--- a/.gitignore
61++++ b/.gitignore
62+@@ -181,6 +181,7 @@ _darcs/
63+ /testlog*
64+ /utils/iserv/iserv.cabal
65+ /utils/iserv-proxy/iserv-proxy.cabal
66++/utils/remote-iserv/remote-iserv.cabal
67+ /utils/mkUserGuidePart/mkUserGuidePart.cabal
68+ /utils/runghc/runghc.cabal
69+ /utils/gen-dll/gen-dll.cabal
70+diff --git a/configure.ac b/configure.ac
71+index e4c4b02fb4..434aa4e29c 100644
72+--- a/configure.ac
73++++ b/configure.ac
74+@@ -1329,7 +1329,7 @@ checkMake380() {
75+ checkMake380 make
76+ checkMake380 gmake
77+
78+-AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/ghc-heap/ghc-heap.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
79++AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/remote-iserv/remote-iserv.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/ghc-heap/ghc-heap.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
80+ AC_OUTPUT
81+ [
82+ if test "$print_make_warning" = "true"; then
183diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst
2−index 49a96caa0b..e974840d7d 100644
84+index 544b8604ef..fa6e6c4780 100644
385--- a/docs/users_guide/ghci.rst
486+++ b/docs/users_guide/ghci.rst
587@@ -3287,6 +3287,38 @@ dynamically-linked) from GHC itself. So for example:
@@ -41,11 +123,38 @@ index 49a96caa0b..e974840d7d 100644
41123 .. _ghci-faq:
42124
43125 FAQ and Things To Watch Out For
126+diff --git a/libraries/libiserv/libiserv.cabal.in b/libraries/libiserv/libiserv.cabal.in
127+index 31eaaeb838..3721a853cc 100644
128+--- a/libraries/libiserv/libiserv.cabal.in
129++++ b/libraries/libiserv/libiserv.cabal.in
130+@@ -33,7 +33,7 @@ Library
131+ if flag(network)
132+ Exposed-Modules: Remote.Message
133+ , Remote.Slave
134+- Build-Depends: network >= 2.6 && < 2.7,
135++ Build-Depends: network >= 2.6 && < 3,
136+ directory >= 1.3 && < 1.4,
137+ filepath >= 1.4 && < 1.5
138+
139+diff --git a/libraries/libiserv/proxy-src/Remote.hs b/libraries/libiserv/proxy-src/Remote.hs
140+index c91b2d08c6..d07220ba7f 100644
141+--- a/libraries/libiserv/proxy-src/Remote.hs
142++++ b/libraries/libiserv/proxy-src/Remote.hs
143+@@ -107,7 +107,8 @@ main = do
144+ putStrLn ("Trying to connect to " ++ host_ip ++ ":" ++ (show port))
145+ out_pipe <- connectTo host_ip port >>= socketToPipe
146+
147+- putStrLn "Starting proxy"
148++ when verbose $
149++ putStrLn "Starting proxy"
150+ proxy verbose in_pipe out_pipe
151+
152+ -- | A hook, to transform outgoing (proxy -> slave)
44153diff --git a/libraries/libiserv/src/Lib.hs b/libraries/libiserv/src/Lib.hs
45−index 57e65706c3..707966dc2d 100644
154+index 57e65706c3..69741fdd73 100644
46155--- a/libraries/libiserv/src/Lib.hs
47156+++ b/libraries/libiserv/src/Lib.hs
48−@@ -10,25 +10,33 @@ import Control.Exception
157+@@ -10,16 +10,24 @@ import Control.Exception
49158 import Control.Monad
50159 import Data.Binary
51160
@@ -63,19 +172,15 @@ index 57e65706c3..707966dc2d 100644
63172 loop = do
64173+ when verbose $ trace "reading pipe..."
65174 Msg msg <- readPipe pipe getMessage >>= hook
66−- discardCtrlC
175++
176+ discardCtrlC
67177
68178- when verbose $ putStrLn ("iserv: " ++ show msg)
69−+ discardCtrlC verbose
70−+
71179+ when verbose $ trace ("msg: " ++ (show msg))
72180 case msg of
73181 Shutdown -> return ()
74−- RunTH st q ty loc -> wrapRunTH $ runTH pipe st q ty loc
75−- RunModFinalizers st qrefs -> wrapRunTH $ runModFinalizerRefs pipe st qrefs
76−+ RunTH st q ty loc -> wrapRunTH verbose $ runTH pipe st q ty loc
77−+ RunModFinalizers st qrefs -> wrapRunTH verbose $ runModFinalizerRefs pipe st qrefs
78− _other -> run msg >>= reply
182+ RunTH st q ty loc -> wrapRunTH $ runTH pipe st q ty loc
183+@@ -28,7 +36,7 @@ serv verbose hook pipe@Pipe{..} restore = loop
79184
80185 reply :: forall a. (Binary a, Show a) => a -> IO ()
81186 reply r = do
@@ -84,17 +189,12 @@ index 57e65706c3..707966dc2d 100644
84189 writePipe pipe (put r)
85190 loop
86191
87−@@ -36,36 +44,43 @@ serv verbose hook pipe@Pipe{..} restore = loop
88− -- THMessage requests, and then finally send RunTHDone followed by a
89− -- QResult. For an overview of how TH works with Remote GHCi, see
192+@@ -38,23 +46,29 @@ serv verbose hook pipe@Pipe{..} restore = loop
90193 -- Note [Remote Template Haskell] in libraries/ghci/GHCi/TH.hs.
91−- wrapRunTH :: forall a. (Binary a, Show a) => IO a -> IO ()
92−- wrapRunTH io = do
93−- r <- try io
94−+ wrapRunTH :: forall a. (Binary a, Show a) => Bool -> IO a -> IO ()
95−+ wrapRunTH verbose io = do
194+ wrapRunTH :: forall a. (Binary a, Show a) => IO a -> IO ()
195+ wrapRunTH io = do
96196+ when verbose $ trace "wrapRunTH..."
97−+ r <- Right <$> io -- try io
197+ r <- try io
98198+ when verbose $ trace "wrapRunTH done."
99199+ when verbose $ trace "writing RunTHDone."
100200 writePipe pipe (putTHMessage RunTHDone)
@@ -105,8 +205,7 @@ index 57e65706c3..707966dc2d 100644
105205+ when verbose $ trace ("QFail " ++ show err)
106206 reply (QFail err :: QResult a)
107207 | otherwise -> do
108−- str <- showException e
109−+ str <- showException verbose e
208+ str <- showException e
110209+ when verbose $ trace ("QException " ++ str)
111210 reply (QException str :: QResult a)
112211 Right a -> do
@@ -116,29 +215,20 @@ index 57e65706c3..707966dc2d 100644
116215
117216 -- carefully when showing an exception, there might be other exceptions
118217 -- lurking inside it. If so, we return the inner exception instead.
119−- showException :: SomeException -> IO String
120−- showException e0 = do
121−+ showException :: Bool -> SomeException -> IO String
122−+ showException verbose e0 = do
218+ showException :: SomeException -> IO String
219+ showException e0 = do
123220+ when verbose $ trace "showException"
124221 r <- try $ evaluate (force (show (e0::SomeException)))
125222 case r of
126−- Left e -> showException e
127−+ Left e -> showException verbose e
128− Right str -> return str
129−
130− -- throw away any pending ^C exceptions while we're not running
223+ Left e -> showException e
224+@@ -64,6 +78,7 @@ serv verbose hook pipe@Pipe{..} restore = loop
131225 -- interpreted code. GHC will also get the ^C, and either ignore it
132226 -- (if this is GHCi), or tell us to quit with a Shutdown message.
133−- discardCtrlC = do
134−+ discardCtrlC verbose = do
227+ discardCtrlC = do
135228+ when verbose $ trace "discardCtrlC"
136229 r <- try $ restore $ return ()
137230 case r of
138−- Left UserInterrupt -> return () >> discardCtrlC
139−+ Left UserInterrupt -> return () >> discardCtrlC verbose
140− Left e -> throwIO e
141− _ -> return ()
231+ Left UserInterrupt -> return () >> discardCtrlC
142232diff --git a/libraries/libiserv/src/Remote/Slave.hs b/libraries/libiserv/src/Remote/Slave.hs
143233index b80d09592f..577161f35f 100644
144234--- a/libraries/libiserv/src/Remote/Slave.hs
@@ -204,6 +294,149 @@ index b80d09592f..577161f35f 100644
204294 handleLoad pipe path (base_path <//> path)
205295 return $ Msg (LoadDLL (base_path <//> path))
206296 _other -> return m
297+diff --git a/testsuite/tests/iserv-remote/Lib.hs b/testsuite/tests/iserv-remote/Lib.hs
298+new file mode 100644
299+index 0000000000..f34fc9d8ab
300+--- /dev/null
301++++ b/testsuite/tests/iserv-remote/Lib.hs
302+@@ -0,0 +1,7 @@
303++{-# LANGUAGE TemplateHaskell #-}
304++module Lib where
305++
306++import Language.Haskell.TH
307++
308++x :: Int -> ExpQ
309++x n = [| 3 + n |]
310+diff --git a/testsuite/tests/iserv-remote/Main.hs b/testsuite/tests/iserv-remote/Main.hs
311+new file mode 100644
312+index 0000000000..dcc2354287
313+--- /dev/null
314++++ b/testsuite/tests/iserv-remote/Main.hs
315+@@ -0,0 +1,5 @@
316++{-# LANGUAGE TemplateHaskell #-}
317++
318++import Lib (x)
319++
320++main = putStrLn "Hello World" >> print $(x 10)
321+diff --git a/testsuite/tests/iserv-remote/Makefile b/testsuite/tests/iserv-remote/Makefile
322+new file mode 100644
323+index 0000000000..409e33be09
324+--- /dev/null
325++++ b/testsuite/tests/iserv-remote/Makefile
326+@@ -0,0 +1,38 @@
327++TOP=../..
328++include $(TOP)/mk/boilerplate.mk
329++include $(TOP)/mk/test.mk
330++
331++SETUP='$(PWD)/Setup' -v0
332++CONFIGURE=$(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db='$(PWD)/tmp.d' --prefix='$(PWD)/inst'
333++
334++remote-iserv: clean
335++ '$(GHC_PKG)' init tmp.d
336++
337++ '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make Setup
338++
339++ cp -r $(TOP)/../libraries/libiserv .
340++ cd libiserv && $(CONFIGURE) -fnetwork
341++ cd libiserv && $(SETUP) build
342++ cd libiserv && $(SETUP) copy
343++ cd libiserv && $(SETUP) register
344++
345++ cp -r $(TOP)/../utils/iserv-proxy .
346++ cd iserv-proxy && $(CONFIGURE)
347++ cd iserv-proxy && $(SETUP) build
348++ cd iserv-proxy && $(SETUP) copy
349++ cd iserv-proxy && $(SETUP) register
350++
351++ cp -r $(TOP)/../utils/remote-iserv .
352++ cd remote-iserv && $(CONFIGURE)
353++ cd remote-iserv && $(SETUP) build
354++ cd remote-iserv && $(SETUP) copy
355++ cd remote-iserv && $(SETUP) register
356++
357++ '$(TEST_HC)' $(TEST_HC_OPTS) -fexternal-interpreter -pgmi $(PWD)/iserv-wrapper Main.hs
358++
359++ifneq "$(CLEANUP)" ""
360++ $(MAKE) -s --no-print-directory clean
361++endif
362++
363++clean :
364++ $(RM) -rf tmp *.o *.hi Main libiserv iserv-proxy remote-iserv tmp.d inst dist Setup$(exeext)
365+diff --git a/testsuite/tests/iserv-remote/Setup.hs b/testsuite/tests/iserv-remote/Setup.hs
366+new file mode 100644
367+index 0000000000..9a994af677
368+--- /dev/null
369++++ b/testsuite/tests/iserv-remote/Setup.hs
370+@@ -0,0 +1,2 @@
371++import Distribution.Simple
372++main = defaultMain
373+diff --git a/testsuite/tests/iserv-remote/all.T b/testsuite/tests/iserv-remote/all.T
374+new file mode 100644
375+index 0000000000..f8f0920835
376+--- /dev/null
377++++ b/testsuite/tests/iserv-remote/all.T
378+@@ -0,0 +1,11 @@
379++def normalise_port(str):
380++ str = re.sub(r'on port [0-9]+', r'on port ****', str)
381++ return str
382++
383++test('remote-iserv'
384++ , [ reqlib('network')
385++ , normalise_fun(normalise_port)
386++ , normalise_errmsg_fun(normalise_port)
387++ , extra_files(['Main.hs', 'Lib.hs', 'iserv-wrapper', 'Setup.hs'])]
388++ , makefile_test
389++ , [])
390+diff --git a/testsuite/tests/iserv-remote/iserv-remote.stderr b/testsuite/tests/iserv-remote/iserv-remote.stderr
391+new file mode 100644
392+index 0000000000..8b13789179
393+--- /dev/null
394++++ b/testsuite/tests/iserv-remote/iserv-remote.stderr
395+@@ -0,0 +1 @@
396++
397+diff --git a/testsuite/tests/iserv-remote/iserv-remote.stdout b/testsuite/tests/iserv-remote/iserv-remote.stdout
398+new file mode 100644
399+index 0000000000..8b13789179
400+--- /dev/null
401++++ b/testsuite/tests/iserv-remote/iserv-remote.stdout
402+@@ -0,0 +1 @@
403++
404+diff --git a/testsuite/tests/iserv-remote/iserv-wrapper b/testsuite/tests/iserv-remote/iserv-wrapper
405+new file mode 100755
406+index 0000000000..6c7da86214
407+--- /dev/null
408++++ b/testsuite/tests/iserv-remote/iserv-wrapper
409+@@ -0,0 +1,12 @@
410++#!/bin/bash
411++PORT=$(($((5000+$RANDOM)) % 10000))
412++
413++(>&2 echo "starting remote-iserv on port $PORT")
414++
415++./inst/bin/remote-iserv tmp $PORT &
416++REMOTE="$!"
417++
418++(>&2 echo "starting iserv-proxy with $@")
419++./inst/bin/iserv-proxy $@ 127.0.0.1 $PORT
420++
421++kill $REMOTE
422+diff --git a/testsuite/tests/iserv-remote/remote-iserv.stderr b/testsuite/tests/iserv-remote/remote-iserv.stderr
423+new file mode 100644
424+index 0000000000..cd6f9d4385
425+--- /dev/null
426++++ b/testsuite/tests/iserv-remote/remote-iserv.stderr
427+@@ -0,0 +1,2 @@
428++starting remote-iserv on port 2051
429++starting iserv-proxy with 13 14
430+diff --git a/testsuite/tests/iserv-remote/remote-iserv.stdout b/testsuite/tests/iserv-remote/remote-iserv.stdout
431+new file mode 100644
432+index 0000000000..b062df0c31
433+--- /dev/null
434++++ b/testsuite/tests/iserv-remote/remote-iserv.stdout
435+@@ -0,0 +1,4 @@
436++[1 of 2] Compiling Lib ( Lib.hs, Lib.o )
437++[2 of 2] Compiling Main ( Main.hs, Main.o )
438++Listening on port 2051
439++Linking Main ...
207440diff --git a/utils/iserv-proxy/Makefile b/utils/iserv-proxy/Makefile
208441index f160978c19..dec92996f7 100644
209442--- a/utils/iserv-proxy/Makefile
@@ -217,8 +450,21 @@ index f160978c19..dec92996f7 100644
217450+dir = iserv-proxy
218451+TOP = ../..
219452 include $(TOP)/mk/sub-makefile.mk
453+diff --git a/utils/iserv-proxy/iserv-proxy.cabal.in b/utils/iserv-proxy/iserv-proxy.cabal.in
454+index 0819064601..cd36426f81 100644
455+--- a/utils/iserv-proxy/iserv-proxy.cabal.in
456++++ b/utils/iserv-proxy/iserv-proxy.cabal.in
457+@@ -73,7 +73,7 @@ Executable iserv-proxy
458+ base >= 4 && < 5,
459+ binary >= 0.7 && < 0.9,
460+ bytestring >= 0.10 && < 0.11,
461+- containers >= 0.5 && < 0.6,
462++ containers >= 0.5 && < 0.8,
463+ deepseq >= 1.4 && < 1.5,
464+ directory >= 1.3 && < 1.4,
465+ network >= 2.6,
220466diff --git a/utils/iserv-proxy/src/Main.hs b/utils/iserv-proxy/src/Main.hs
221−index c91b2d08c6..3970ad5df1 100644
467+index c91b2d08c6..5901ffe562 100644
222468--- a/utils/iserv-proxy/src/Main.hs
223469+++ b/utils/iserv-proxy/src/Main.hs
224470@@ -1,4 +1,4 @@
@@ -250,7 +496,7 @@ index c91b2d08c6..3970ad5df1 100644
250496 args <- getArgs
251497 (wfd1, rfd2, host_ip, port, rest) <-
252498 case args of
253−@@ -104,10 +113,16 @@ main = do
499+@@ -104,10 +113,17 @@ main = do
254500 let in_pipe = Pipe{pipeRead = inh, pipeWrite = outh, pipeLeftovers = lo_ref}
255501
256502 when verbose $
@@ -260,17 +506,18 @@ index c91b2d08c6..3970ad5df1 100644
260506
261507- putStrLn "Starting proxy"
262508+ out_pipe <- do
263−+ let go n = E.try (connectTo host_ip port >>= socketToPipe) >>= \case
509++ let go n = E.try (connectTo verbose host_ip port >>= socketToPipe) >>= \case
264510+ Left e | n == 0 -> E.throw (e :: E.SomeException)
265511+ | n > 0 -> threadDelay 500000 >> go (n - 1)
266512+ Right a -> return a
267513+ in go 120 -- wait for up to 60seconds (polling every 0.5s).
268514+
269−+ trace "Starting proxy"
515++ when verbose $
516++ trace "Starting proxy"
270517 proxy verbose in_pipe out_pipe
271518
272519 -- | A hook, to transform outgoing (proxy -> slave)
273−@@ -131,19 +146,24 @@ fwdTHMsg local msg = do
520+@@ -131,19 +147,24 @@ fwdTHMsg local msg = do
274521 -- | Fowarard a @Message@ call and handle @THMessages@.
275522 fwdTHCall :: (Binary a) => Bool -> Pipe -> Pipe -> Message a -> IO a
276523 fwdTHCall verbose local remote msg = do
@@ -297,7 +544,7 @@ index c91b2d08c6..3970ad5df1 100644
297544 writePipe remote (put res)
298545 case msg' of
299546 RunTHDone -> return ()
300−@@ -161,8 +181,10 @@ fwdTHCall verbose local remote msg = do
547+@@ -161,8 +182,10 @@ fwdTHCall verbose local remote msg = do
301548 --
302549 fwdLoadCall :: (Binary a, Show a) => Bool -> Pipe -> Pipe -> Message a -> IO a
303550 fwdLoadCall verbose _ remote msg = do
@@ -308,7 +555,7 @@ index c91b2d08c6..3970ad5df1 100644
308555 readPipe remote get
309556 where
310557 truncateMsg :: Int -> String -> String
311−@@ -171,17 +193,19 @@ fwdLoadCall verbose _ remote msg = do
558+@@ -171,17 +194,20 @@ fwdLoadCall verbose _ remote msg = do
312559 reply :: (Binary a, Show a) => a -> IO ()
313560 reply m = do
314561 when verbose $
@@ -326,11 +573,12 @@ index c91b2d08c6..3970ad5df1 100644
326573 case msg' of
327574 Done -> return ()
328575 Missing path -> do
329−+ trace $ "fwdLoadCall: missing path: " ++ path
576++ when verbose $
577++ trace $ "fwdLoadCall: missing path: " ++ path
330578 reply =<< BS.readFile path
331579 loopLoad
332580 Have path remoteHash -> do
333−@@ -198,21 +222,33 @@ proxy verbose local remote = loop
581+@@ -198,21 +224,33 @@ proxy verbose local remote = loop
334582 where
335583 fwdCall :: (Binary a, Show a) => Message a -> IO a
336584 fwdCall msg = do
@@ -366,7 +614,7 @@ index c91b2d08c6..3970ad5df1 100644
366614 case msg' of
367615 -- TH might send some message back to ghc.
368616 RunTH{} -> do
369−@@ -233,6 +269,10 @@ proxy verbose local remote = loop
617+@@ -233,6 +271,10 @@ proxy verbose local remote = loop
370618 resp <- fwdLoadCall verbose local remote msg'
371619 reply resp
372620 loop
@@ -377,10 +625,12 @@ index c91b2d08c6..3970ad5df1 100644
377625 LoadDLL path | isAbsolute path -> do
378626 resp <- fwdLoadCall verbose local remote msg'
379627 reply resp
380−@@ -243,14 +283,19 @@ proxy verbose local remote = loop
628+@@ -241,16 +283,23 @@ proxy verbose local remote = loop
629+ _other -> fwdCall msg' >>= reply >> loop
630+
381631
382− connectTo :: String -> PortNumber -> IO Socket
383− connectTo host port = do
632+-connectTo :: String -> PortNumber -> IO Socket
633+-connectTo host port = do
384634- let hints = defaultHints { addrFlags = [AI_NUMERICHOST, AI_NUMERICSERV]
385635- , addrSocketType = Stream }
386636- addr:_ <- getAddrInfo (Just hints) (Just host) (Just (show port))
@@ -389,6 +639,8 @@ index c91b2d08c6..3970ad5df1 100644
389639- connect sock (addrAddress addr)
390640- putStrLn "connected"
391641- return sock
642++connectTo :: Bool -> String -> PortNumber -> IO Socket
643++connectTo verbose host port = do
392644+ addr <- resolve host (show port)
393645+ open addr
394646+ where
@@ -398,9 +650,11 @@ index c91b2d08c6..3970ad5df1 100644
398650+ return addr
399651+ open addr = do
400652+ sock <- socket (addrFamily addr) (addrSocketType addr) (addrProtocol addr)
401−+ trace $ "Created socket for " ++ host ++ ":" ++ show port
653++ when verbose $
654++ trace $ "Created socket for " ++ host ++ ":" ++ show port
402655+ connect sock $ addrAddress addr
403−+ trace "connected"
656++ when verbose $
657++ trace "connected"
404658+ return sock
405659
406660 -- | Turn a socket into an unbuffered pipe.
@@ -555,13 +809,13 @@ index 0000000000..db8f32fc22
555809+all_ghc_stage2 : $(remote-iserv-stage2_dyn_INPLACE)
556810diff --git a/utils/remote-iserv/remote-iserv.cabal.in b/utils/remote-iserv/remote-iserv.cabal.in
557811new file mode 100644
558−index 0000000000..2e9123bf5e
812+index 0000000000..a1cba01301
559813--- /dev/null
560814+++ b/utils/remote-iserv/remote-iserv.cabal.in
561815@@ -0,0 +1,27 @@
562−+-- WARNING: iserv-proxy.cabal is automatically generated from iserv-proxy.cabal.in by
563−+-- ../../configure. Make sure you are editing iserv-proxy.cabal.in, not
564−+-- iserv-proxy.cabal.
816++-- WARNING: iserv-proxy.cabal is automatically generated from remote-iserv.cabal.in by
817++-- ../../configure. Make sure you are editing remote-iserv.cabal.in, not
818++-- remote-iserv.cabal.
565819+
566820+Name: remote-iserv
567821+Version: @ProjectVersion@
@@ -622,3 +876,6 @@ index 0000000000..eb8f92c39c
622876+ _ -> dieWithUsage
623877+
624878+ startSlave' verbose path port
879+--
880+2.24.1
881+
overlays/patches/ghc/move-iserv-8.4.2.patch → overlays/patches/ghc/iserv-move-8.4.1.patchrenamed+86−161
@@ -1,32 +1,81 @@
1−diff --git a/aclocal.m4 b/aclocal.m4
2−index ac20bbc630..0e3a302ef6 100644
3−--- a/aclocal.m4
4−+++ b/aclocal.m4
5−@@ -2383,7 +2383,8 @@ AC_DEFUN([FIND_LD],[
6− FP_CC_LINKER_FLAG_TRY(bfd, $2) ;;
7− "GNU gold"*)
8− FP_CC_LINKER_FLAG_TRY(gold, $2)
9−- LD_NO_GOLD=ld
10−+ LD_NO_GOLD=
11−+ AC_CHECK_TARGET_TOOL([LD_NO_GOLD],[ld])
12− ;;
13− "LLD"*)
14− FP_CC_LINKER_FLAG_TRY(lld, $2) ;;
15−diff --git a/configure.ac b/configure.ac
16−index b74938f7da..8bed181915 100644
17−--- a/configure.ac
18−+++ b/configure.ac
19−@@ -16,7 +16,7 @@ dnl
20− AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.4.2], [glasgow-haskell-bugs@haskell.org], [ghc-AC_PACKAGE_VERSION])
1+From 290992a9006ca83c74aae165d456d2c000a5e632 Mon Sep 17 00:00:00 2001
2+From: Moritz Angermann <moritz.angermann@gmail.com>
3+Date: Thu, 7 Jun 2018 13:36:24 -0400
4+Subject: [PATCH] Move `iserv` into `utils` and change package name from
5+ `iserv-bin` to `iserv`
6+
7+This is done for consistency. We usually call the package file the same name the
8+folder has. The move into `utils` is done so that we can move the library into
9+`libraries/iserv` and the proxy into `utils/iserv-proxy` and then break the
10+`iserv.cabal` apart. This will make building the cross compiler with TH
11+simpler, because we can build the library and proxy as separate packages.
12+
13+Test Plan: ./validate
14+
15+Reviewers: bgamari, goldfire, erikd
16+
17+Reviewed By: bgamari
18+
19+Subscribers: rwbarton, thomie, carter
20+
21+Differential Revision: https://phabricator.haskell.org/D4436
22+---
23+ .gitignore | 3 +-
24+ ghc.mk | 11 +-
25+ {iserv => libraries/libiserv}/Makefile | 0
26+ .../libiserv}/cbits/iservmain.c | 0
27+ libraries/libiserv/ghc.mk | 5 +
28+ libraries/libiserv/libiserv.cabal | 39 +++
29+ .../libiserv}/proxy-src/Remote.hs | 0
30+ .../libiserv}/src/GHCi/Utils.hsc | 0
31+ {iserv => libraries/libiserv}/src/Lib.hs | 0
32+ .../libiserv}/src/Remote/Message.hs | 0
33+ .../libiserv}/src/Remote/Slave.hs | 0
34+ utils/iserv-proxy/Makefile | 15 +
35+ utils/iserv-proxy/ghc.mk | 113 ++++++++
36+ .../iserv-proxy/iserv-proxy.cabal | 72 +----
37+ utils/iserv-proxy/src/Main.hs | 262 ++++++++++++++++++
38+ utils/iserv/Makefile | 15 +
39+ utils/iserv/cbits/iservmain.c | 17 ++
40+ {iserv => utils/iserv}/ghc.mk | 66 ++---
41+ utils/iserv/iserv.cabal | 44 +++
42+ {iserv => utils/iserv}/src/Main.hs | 0
43+ 20 files changed, 555 insertions(+), 107 deletions(-)
44+ rename {iserv => libraries/libiserv}/Makefile (100%)
45+ rename {iserv => libraries/libiserv}/cbits/iservmain.c (100%)
46+ create mode 100644 libraries/libiserv/ghc.mk
47+ create mode 100644 libraries/libiserv/libiserv.cabal
48+ rename {iserv => libraries/libiserv}/proxy-src/Remote.hs (100%)
49+ rename {iserv => libraries/libiserv}/src/GHCi/Utils.hsc (100%)
50+ rename {iserv => libraries/libiserv}/src/Lib.hs (100%)
51+ rename {iserv => libraries/libiserv}/src/Remote/Message.hs (100%)
52+ rename {iserv => libraries/libiserv}/src/Remote/Slave.hs (100%)
53+ create mode 100644 utils/iserv-proxy/Makefile
54+ create mode 100644 utils/iserv-proxy/ghc.mk
55+ rename iserv/iserv-bin.cabal => utils/iserv-proxy/iserv-proxy.cabal (61%)
56+ create mode 100644 utils/iserv-proxy/src/Main.hs
57+ create mode 100644 utils/iserv/Makefile
58+ create mode 100644 utils/iserv/cbits/iservmain.c
59+ rename {iserv => utils/iserv}/ghc.mk (56%)
60+ create mode 100644 utils/iserv/iserv.cabal
61+ rename {iserv => utils/iserv}/src/Main.hs (100%)
62+
63+diff --git a/.gitignore b/.gitignore
64+index 67eea8a29f..0d3a3a24d8 100644
65+--- a/.gitignore
66++++ b/.gitignore
67+@@ -81,8 +81,7 @@ _darcs/
68+ /ghc/stage1/
69+ /ghc/stage2/
70+ /ghc/stage3/
71+-/iserv/stage2*/
72+-/iserv/dist/
73++/utils/iserv/stage2*/
2174
22− # Set this to YES for a released version, otherwise NO
23−-: ${RELEASE=YES}
24−+: ${RELEASE=NO}
25−
26− # The primary version (e.g. 7.5, 7.4.1) is set in the AC_INIT line
27− # above. If this is not a released version, then we will append the
75+ # -----------------------------------------------------------------------------
76+ # specific generated files
2877diff --git a/ghc.mk b/ghc.mk
29−index 38c165d261..1a99aa3bb0 100644
78+index 38c165d261..b7bcc92196 100644
3079--- a/ghc.mk
3180+++ b/ghc.mk
3281@@ -473,6 +473,7 @@ endif
@@ -59,15 +108,6 @@ index 38c165d261..1a99aa3bb0 100644
59108
60109 # ----------------------------------------------
61110 # Actually include the sub-ghc.mk's
62−@@ -1105,7 +1106,7 @@ BIN_DIST_MK = $(BIN_DIST_PREP_DIR)/bindist.mk
63− unix-binary-dist-prep:
64− $(call removeTrees,bindistprep/)
65− "$(MKDIRHIER)" $(BIN_DIST_PREP_DIR)
66−- set -e; for i in packages LICENSE compiler ghc iserv rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh settings.in llvm-targets ghc.mk inplace distrib/configure.ac distrib/README distrib/INSTALL; do ln -s ../../$$i $(BIN_DIST_PREP_DIR)/; done
67−+ set -e; for i in packages LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh settings.in llvm-targets ghc.mk inplace distrib/configure.ac distrib/README distrib/INSTALL; do ln -s ../../$$i $(BIN_DIST_PREP_DIR)/; done
68− echo "HADDOCK_DOCS = $(HADDOCK_DOCS)" >> $(BIN_DIST_MK)
69− echo "BUILD_SPHINX_HTML = $(BUILD_SPHINX_HTML)" >> $(BIN_DIST_MK)
70− echo "BUILD_SPHINX_PDF = $(BUILD_SPHINX_PDF)" >> $(BIN_DIST_MK)
71111@@ -1199,7 +1200,7 @@ SRC_DIST_TESTSUITE_TARBALL = $(SRC_DIST_ROOT)/$(SRC_DIST_TESTSUITE_NAME).
72112 # Files to include in source distributions
73113 #
@@ -98,7 +138,7 @@ index 0000000000..6dc323b336
98138+$(if $(filter libiserv,$(PACKAGES_STAGE2)),$(eval $(call build-package,libraries/libiserv,dist-install,2)))
99139diff --git a/libraries/libiserv/libiserv.cabal b/libraries/libiserv/libiserv.cabal
100140new file mode 100644
101−index 0000000000..3a5368e6bd
141+index 0000000000..43f1180073
102142--- /dev/null
103143+++ b/libraries/libiserv/libiserv.cabal
104144@@ -0,0 +1,39 @@
@@ -140,7 +180,7 @@ index 0000000000..3a5368e6bd
140180+ if os(windows)
141181+ Cpp-Options: -DWINDOWS
142182+ else
143−+ Build-Depends: unix >= 2.7 && < 2.8
183++ Build-Depends: unix >= 2.7 && < 2.9
144184diff --git a/iserv/proxy-src/Remote.hs b/libraries/libiserv/proxy-src/Remote.hs
145185similarity index 100%
146186rename from iserv/proxy-src/Remote.hs
@@ -158,45 +198,9 @@ similarity index 100%
158198rename from iserv/src/Remote/Message.hs
159199rename to libraries/libiserv/src/Remote/Message.hs
160200diff --git a/iserv/src/Remote/Slave.hs b/libraries/libiserv/src/Remote/Slave.hs
161−similarity index 94%
201+similarity index 100%
162202rename from iserv/src/Remote/Slave.hs
163203rename to libraries/libiserv/src/Remote/Slave.hs
164−index b80d09592f..701e7d24c9 100644
165−--- a/iserv/src/Remote/Slave.hs
166−+++ b/libraries/libiserv/src/Remote/Slave.hs
167−@@ -112,14 +112,18 @@ hook verbose base_path pipe m = case m of
168− handleLoad pipe path (base_path <//> path)
169− return $ Msg (LoadObj (base_path <//> path))
170− Msg (LoadArchive path) -> do
171−+ when verbose $ putStrLn ("Need Archieve: " ++ path ++ " at " ++ (base_path <//> path))
172− handleLoad pipe path (base_path <//> path)
173− return $ Msg (LoadArchive (base_path <//> path))
174− -- when loading DLLs (.so, .dylib, .dll, ...) and these are provided
175− -- as relative paths, the intention is to load a pre-existing system library,
176− -- therefore we hook the LoadDLL call only for absolute paths to ship the
177− -- dll from the host to the target.
178−+ Msg (LoadDLL path@('C':':':_)) -> do
179−+ when verbose $ putStrLn ("Need DLL: " ++ path)
180−+ return $ Msg (LoadDLL path)
181− Msg (LoadDLL path) | isAbsolute path -> do
182−- when verbose $ putStrLn ("Need DLL: " ++ (base_path <//> path))
183−+ when verbose $ putStrLn ("Need DLL: " ++ path ++ " at " ++ (base_path <//> path))
184− handleLoad pipe path (base_path <//> path)
185− return $ Msg (LoadDLL (base_path <//> path))
186− _other -> return m
187−diff --git a/mk/config.mk.in b/mk/config.mk.in
188−index e5ec04a195..0c8e1bb7e3 100644
189−--- a/mk/config.mk.in
190−+++ b/mk/config.mk.in
191−@@ -537,7 +537,7 @@ AS_STAGE1 = $(AS)
192− AS_STAGE2 = $(AS)
193− AS_STAGE3 = $(AS)
194−
195−-# why no LD=@LD@ ?
196−+LD = @LD@
197− LD_STAGE0 = @LD_STAGE0@
198− LD_STAGE1 = $(LD)
199− LD_STAGE2 = $(LD)
200204diff --git a/utils/iserv-proxy/Makefile b/utils/iserv-proxy/Makefile
201205new file mode 100644
202206index 0000000000..f160978c19
@@ -218,16 +222,6 @@ index 0000000000..f160978c19
218222+dir = iserv
219223+TOP = ..
220224+include $(TOP)/mk/sub-makefile.mk
221−diff --git a/utils/iserv-proxy/cabal.project b/utils/iserv-proxy/cabal.project
222−new file mode 100644
223−index 0000000000..2e6cd12dc9
224−--- /dev/null
225−+++ b/utils/iserv-proxy/cabal.project
226−@@ -0,0 +1,4 @@
227−+packages: . ../../libraries/libiserv
228−+
229−+package libiserv
230−+ flags: +network
231225diff --git a/utils/iserv-proxy/ghc.mk b/utils/iserv-proxy/ghc.mk
232226new file mode 100644
233227index 0000000000..b90a96a1fa
@@ -351,14 +345,14 @@ diff --git a/iserv/iserv-bin.cabal b/utils/iserv-proxy/iserv-proxy.cabal
351345similarity index 61%
352346rename from iserv/iserv-bin.cabal
353347rename to utils/iserv-proxy/iserv-proxy.cabal
354−index 4c68d8b392..0ab0cfcff2 100644
348+index 4c68d8b392..fa25c77794 100644
355349--- a/iserv/iserv-bin.cabal
356350+++ b/utils/iserv-proxy/iserv-proxy.cabal
357351@@ -1,5 +1,5 @@
358352-Name: iserv-bin
359353-Version: 0.0
360354+Name: iserv-proxy
361−+Version: 8.5
355++Version: 8.4
362356 Copyright: XXX
363357 License: BSD3
364358 -- XXX License-File: LICENSE
@@ -711,78 +705,6 @@ index 0000000000..c91b2d08c6
711705+
712706+ lo_ref <- newIORef Nothing
713707+ pure Pipe{ pipeRead = hdl, pipeWrite = hdl, pipeLeftovers = lo_ref }
714−diff --git a/utils/iserv-slave/cabal.project b/utils/iserv-slave/cabal.project
715−new file mode 100644
716−index 0000000000..2e6cd12dc9
717−--- /dev/null
718−+++ b/utils/iserv-slave/cabal.project
719−@@ -0,0 +1,4 @@
720−+packages: . ../../libraries/libiserv
721−+
722−+package libiserv
723−+ flags: +network
724−diff --git a/utils/iserv-slave/iserv-slave.cabal b/utils/iserv-slave/iserv-slave.cabal
725−new file mode 100644
726−index 0000000000..7f82f3d125
727−--- /dev/null
728−+++ b/utils/iserv-slave/iserv-slave.cabal
729−@@ -0,0 +1,20 @@
730−+Name: iserv-slave
731−+Version: 8.4
732−+Copyright: XXX
733−+License: BSD3
734−+-- XXX License-File: LICENSE
735−+Author: XXX
736−+Maintainer: XXX
737−+Synopsis: iserv allows GHC to delegate Tempalte Haskell computations
738−+Description:
739−+Category: Development
740−+build-type: Simple
741−+cabal-version: >=1.10
742−+
743−+Executable iserv-slave
744−+ Default-Language: Haskell2010
745−+ Main-Is: Cli.hs
746−+ Hs-Source-Dirs: src
747−+ Build-Depends:
748−+ base >= 4 && < 5,
749−+ libiserv == 8.4
750−diff --git a/utils/iserv-slave/src/Cli.hs b/utils/iserv-slave/src/Cli.hs
751−new file mode 100644
752−index 0000000000..8a3a34f9c4
753−--- /dev/null
754−+++ b/utils/iserv-slave/src/Cli.hs
755−@@ -0,0 +1,30 @@
756−+module Main where
757−+
758−+import System.Environment (getProgName, getArgs)
759−+import System.Exit (die)
760−+import Remote.Slave (startSlave')
761−+
762−+main :: IO ()
763−+main = getArgs >>= startSlave
764−+
765−+dieWithUsage :: IO a
766−+dieWithUsage = do
767−+ prog <- getProgName
768−+ die $ prog ++ ": " ++ msg
769−+ where
770−+ msg = "usage: iserv-slave /path/to/storage PORT [-v]"
771−+
772−+startSlave :: [String] -> IO ()
773−+startSlave args0
774−+ | "--help" `elem` args0 = dieWithUsage
775−+ | otherwise = do
776−+ (path, port, rest) <- case args0 of
777−+ arg0:arg1:rest -> return (arg0, read arg1, rest)
778−+ _ -> dieWithUsage
779−+ verbose <- case rest of
780−+ ["-v"] -> return True
781−+ [] -> return False
782−+ _ -> dieWithUsage
783−+
784−+ startSlave' verbose path port
785−+
786708diff --git a/utils/iserv/Makefile b/utils/iserv/Makefile
787709new file mode 100644
788710index 0000000000..361985852f
@@ -947,7 +869,7 @@ index c5ca6a524e..194621a85c 100644
947869 all_ghc_stage2 : $(iserv-stage2_INPLACE)
948870diff --git a/utils/iserv/iserv.cabal b/utils/iserv/iserv.cabal
949871new file mode 100644
950−index 0000000000..f2a0a41102
872+index 0000000000..768c0e0f83
951873--- /dev/null
952874+++ b/utils/iserv/iserv.cabal
953875@@ -0,0 +1,44 @@
@@ -994,8 +916,11 @@ index 0000000000..f2a0a41102
994916+ if os(windows)
995917+ Cpp-Options: -DWINDOWS
996918+ else
997−+ Build-Depends: unix >= 2.7 && < 2.8
919++ Build-Depends: unix >= 2.7 && < 2.9
998920diff --git a/iserv/src/Main.hs b/utils/iserv/src/Main.hs
999921similarity index 100%
1000922rename from iserv/src/Main.hs
1001923rename to utils/iserv/src/Main.hs
924+--
925+2.24.1
926+