Skip to content

Commit 48953b3

Browse files
committed
[ change ] Replace WASM git submodules with cabal source-repository-package
1 parent 5e52fe2 commit 48953b3

File tree

4 files changed

+41
-15
lines changed

4 files changed

+41
-15
lines changed

.github/workflows/wasm.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
- uses: actions/checkout@v4
2222
with:
2323
path: als
24-
submodules: recursive
2524

2625
- name: Compute cache key
2726
run: echo "CI_CACHE_KEY=${{ runner.os }}-${{ runner.arch }}-${{ env.GHC_WASM_META_COMMIT_HASH }}-flavor-${{ env.GHC_WASM_META_FLAVOUR }}" >> "$GITHUB_ENV"
@@ -80,10 +79,17 @@ jobs:
8079
echo ">>> Install alex and happy"
8180
~/.ghc-wasm/cabal/bin/cabal install alex-3.5.0.0 happy-1.20.1.1
8281
83-
- name: Cabal configure
82+
- name: Setup and configure
8483
working-directory: './als'
8584
run: |
8685
mv cabal.project.wasm32 cabal.project
86+
# Download sources first
87+
wasm32-wasi-cabal build --dry-run
88+
# Setup network package autotools
89+
cd dist-newstyle/src/network-*/
90+
autoreconf -i
91+
cd ../../..
92+
# Now configure
8793
wasm32-wasi-cabal configure --flag=Agda-2-7-0-1
8894
8995
- name: 'Build dep: lsp-types'
@@ -106,12 +112,9 @@ jobs:
106112
path: als/dist-newstyle
107113
key: dist-newstyle-${{ env.CI_CACHE_KEY }}-${{ hashFiles('als/dist-newstyle/**') }}
108114

109-
- name: Build every dependency else
115+
- name: Build dependencies
110116
working-directory: './als'
111117
run: |
112-
cd wasm-submodules/network
113-
autoreconf -i
114-
cd ../..
115118
wasm32-wasi-cabal build --dependencies-only
116119
117120
- name: Build als

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ node_modules/
1919
*.hp
2020
*.eventlog
2121
cabal.sandbox.config
22+
cabal.project
2223
cabal.project.local
2324
*~
2425

BUILDING_WASM.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# How to build for WASM
22

33
1. Setup a working ghc (tested with v9.10) with WASM backend and wasm32-wasi-cabal.
4-
2. `cd` into `wasm-submodules/network` and run `autoreconf -i`.
5-
3. In the project root, run `cp cabal.project{.wasm32,}`, and then `wasm32-wasi-cabal build`.
4+
2. In the project root, run `cp cabal.project{.wasm32,}`, and then `wasm32-wasi-cabal build`.
5+
6+
Note: This project uses cabal's built-in git dependency handling instead of git submodules. The network package requires autotools (`autoreconf -i`) which is handled automatically in CI, but for local builds you may need to run it manually if the build fails.
67

78
The process might output the following:
89

cabal.project.wasm32

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
1-
packages:
2-
.
3-
wasm-submodules/agda
4-
wasm-submodules/foundation/basement
5-
wasm-submodules/network
6-
wasm-submodules/network-simple-0.4.2
7-
wasm-submodules/lsp/lsp-types
1+
packages: .
2+
3+
source-repository-package
4+
type: git
5+
location: https://github.com/agda-web/agda.git
6+
tag: 87cac9ce17932321dc1a0fdaed83436de22fa0aa
7+
8+
source-repository-package
9+
type: git
10+
location: https://github.com/haskell-wasm/foundation.git
11+
tag: 8e6dd48527fb429c1922083a5030ef88e3d58dd3
12+
subdir: basement
13+
14+
source-repository-package
15+
type: git
16+
location: https://github.com/haskell-wasm/network.git
17+
tag: ca0a569a083adc95fb0479168692a08e978d2599
18+
19+
source-repository-package
20+
type: git
21+
location: https://github.com/agda-web/lsp.git
22+
tag: 9baf76e6d9965a3b6e8b3ecfcdf33c62b5628fd8
23+
subdir: lsp-types
24+
25+
source-repository-package
26+
type: git
27+
location: https://github.com/k0001/network-simple.git
28+
tag: 2c3ab6e7aa2a86be692c55bf6081161d83d50c34
829

930
package Agda
1031
flags: +optimise-heavily

0 commit comments

Comments
 (0)