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() {
672 checkMake380 make
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+
0 commit comments