Skip to content

Commit 9b7f1d0

Browse files
committed
[ change ] Backport WASM conditions from cabal to Stack configuration
- Add arch(wasm32) conditionals to package.yaml matching cabal file - Pin network-simple==0.4.2 and exclude threading for WASM builds - Enable Stack to generate equivalent WASM-compatible cabal files
1 parent 5b19b4f commit 9b7f1d0

File tree

4 files changed

+43
-15
lines changed

4 files changed

+43
-15
lines changed

agda-language-server.cabal

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ library
8282
PatternSynonyms
8383
TypeOperators
8484
ghc-options: -Wincomplete-patterns -Wunused-do-bind -Wunused-foralls -Wwarnings-deprecations -Wwrong-do-bind -Wmissing-fields -Wmissing-methods -Wmissing-pattern-synonym-signatures -Wmissing-signatures -Werror=incomplete-patterns -fno-warn-orphans
85-
if !arch(wasm32)
86-
ghc-options: -threaded -with-rtsopts=-N
8785
build-depends:
8886
Agda
8987
, aeson
@@ -96,7 +94,7 @@ library
9694
, lsp-types >=2
9795
, mtl
9896
, network
99-
, network-simple == 0.4.2
97+
, network-simple ==0.4.2
10098
, prettyprinter
10199
, process
102100
, stm
@@ -115,6 +113,8 @@ library
115113
if arch(wasm32)
116114
build-depends:
117115
unix >=2.8.0.0 && <2.9
116+
if !arch(wasm32)
117+
ghc-options: -threaded -with-rtsopts=-N
118118

119119
executable als
120120
main-is: Main.hs
@@ -128,8 +128,6 @@ executable als
128128
PatternSynonyms
129129
TypeOperators
130130
ghc-options: -Wincomplete-patterns -Wunused-do-bind -Wunused-foralls -Wwarnings-deprecations -Wwrong-do-bind -Wmissing-fields -Wmissing-methods -Wmissing-pattern-synonym-signatures -Wmissing-signatures -rtsopts -Werror=incomplete-patterns -fno-warn-orphans
131-
if !arch(wasm32)
132-
ghc-options: -threaded -with-rtsopts=-N
133131
build-depends:
134132
Agda
135133
, aeson
@@ -143,7 +141,7 @@ executable als
143141
, lsp-types >=2
144142
, mtl
145143
, network
146-
, network-simple == 0.4.2
144+
, network-simple ==0.4.2
147145
, prettyprinter
148146
, process
149147
, stm
@@ -159,6 +157,11 @@ executable als
159157
if flag(Agda-2-7-0-1)
160158
build-depends:
161159
Agda ==2.7.0.1
160+
if arch(wasm32)
161+
build-depends:
162+
unix >=2.8.0.0 && <2.9
163+
if !arch(wasm32)
164+
ghc-options: -threaded -with-rtsopts=-N
162165

163166
test-suite als-test
164167
type: exitcode-stdio-1.0
@@ -201,8 +204,6 @@ test-suite als-test
201204
PatternSynonyms
202205
TypeOperators
203206
ghc-options: -Wincomplete-patterns -Wunused-do-bind -Wunused-foralls -Wwarnings-deprecations -Wwrong-do-bind -Wmissing-fields -Wmissing-methods -Wmissing-pattern-synonym-signatures -Wmissing-signatures -rtsopts -Werror=incomplete-patterns -fno-warn-orphans
204-
if !arch(wasm32)
205-
ghc-options: -threaded -with-rtsopts=-N
206207
build-depends:
207208
Agda
208209
, aeson
@@ -216,7 +217,7 @@ test-suite als-test
216217
, lsp-types >=2
217218
, mtl
218219
, network
219-
, network-simple == 0.4.2
220+
, network-simple ==0.4.2
220221
, prettyprinter
221222
, process
222223
, stm
@@ -236,3 +237,8 @@ test-suite als-test
236237
if flag(Agda-2-7-0-1)
237238
build-depends:
238239
Agda ==2.7.0.1
240+
if arch(wasm32)
241+
build-depends:
242+
unix >=2.8.0.0 && <2.9
243+
if !arch(wasm32)
244+
ghc-options: -threaded -with-rtsopts=-N

package.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ when:
4848
- condition: "flag(Agda-2-7-0-1)"
4949
dependencies:
5050
- Agda == 2.7.0.1
51+
- condition: "arch(wasm32)"
52+
dependencies:
53+
- unix >= 2.8.0.0 && < 2.9
5154
# - condition: "flag(Agda-2-6-2-2) && flag(Agda-2-6-3)"
5255
# dependencies:
5356
# - Agda < 0
@@ -64,7 +67,7 @@ dependencies:
6467
- lsp >= 2
6568
- mtl
6669
- network
67-
- network-simple
70+
- network-simple == 0.4.2
6871
- strict
6972
- stm
7073
- text
@@ -91,6 +94,11 @@ library:
9194
- -Wmissing-signatures
9295
- -Werror=incomplete-patterns
9396
- -fno-warn-orphans
97+
when:
98+
- condition: "!arch(wasm32)"
99+
ghc-options:
100+
- -threaded
101+
- -with-rtsopts=-N
94102

95103
executables:
96104
als:
@@ -106,11 +114,14 @@ executables:
106114
- -Wmissing-methods
107115
- -Wmissing-pattern-synonym-signatures
108116
- -Wmissing-signatures
109-
- -threaded
110117
- -rtsopts
111-
- -with-rtsopts=-N
112118
- -Werror=incomplete-patterns
113119
- -fno-warn-orphans
120+
when:
121+
- condition: "!arch(wasm32)"
122+
ghc-options:
123+
- -threaded
124+
- -with-rtsopts=-N
114125
dependencies:
115126
- agda-language-server
116127

@@ -137,11 +148,14 @@ tests:
137148
- -Wmissing-methods
138149
- -Wmissing-pattern-synonym-signatures
139150
- -Wmissing-signatures
140-
- -threaded
141151
- -rtsopts
142-
- -with-rtsopts=-N
143152
- -Werror=incomplete-patterns
144153
- -fno-warn-orphans
154+
when:
155+
- condition: "!arch(wasm32)"
156+
ghc-options:
157+
- -threaded
158+
- -with-rtsopts=-N
145159

146160
# tests:
147161
# als-test:

stack.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extra-deps:
1313
- lsp-test-0.17.1.0@sha256:f54757a564b46783cf67b13f4cb4ebc45e43f5afc3604d9757ee387c091b73e9,4406
1414
- mod-0.2.0.1@sha256:eeb316fef3a8c12f4e83bbeeea748e74d75fca54d4498d574ace92e464adb05a,2409
1515
- row-types-1.0.1.2@sha256:4d4c7cb95d06a32b28ba977852d52a26b4c1f695ef083a6fd874ab6d79933b64,3071
16+
- network-simple-0.4.2@sha256:3614a0b7e51bcafb5643c3dc3a3a89d20a99671998c8814eb6fc55fa99e38444,1375
1617

1718
flags:
1819
Agda:

stack.yaml.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file was autogenerated by Stack.
22
# You should not edit this file by hand.
33
# For more information, please see the documentation at:
4-
# https://docs.haskellstack.org/en/stable/lock_files
4+
# https://docs.haskellstack.org/en/stable/topics/lock_files
55

66
packages:
77
- completed:
@@ -46,6 +46,13 @@ packages:
4646
size: 1060
4747
original:
4848
hackage: row-types-1.0.1.2@sha256:4d4c7cb95d06a32b28ba977852d52a26b4c1f695ef083a6fd874ab6d79933b64,3071
49+
- completed:
50+
hackage: network-simple-0.4.2@sha256:3614a0b7e51bcafb5643c3dc3a3a89d20a99671998c8814eb6fc55fa99e38444,1375
51+
pantry-tree:
52+
sha256: dd29b2be85ddbc79edd268c27e7c49eb939a4478ee9f2be410a199e768ec5783
53+
size: 564
54+
original:
55+
hackage: network-simple-0.4.2@sha256:3614a0b7e51bcafb5643c3dc3a3a89d20a99671998c8814eb6fc55fa99e38444,1375
4956
snapshots:
5057
- completed:
5158
sha256: 5a59b2a405b3aba3c00188453be172b85893cab8ebc352b1ef58b0eae5d248a2

0 commit comments

Comments
 (0)