Skip to content

Commit f34a1ed

Browse files
committed
[ change ] Replace WASM git submodules with cabal source-repository-package for network
1 parent 270a9bf commit f34a1ed

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

.github/workflows/wasm.yaml

Lines changed: 10 additions & 7 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: true
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"
@@ -73,8 +72,11 @@ jobs:
7372
if: steps.ghc-wasm-setup.outcome == 'success' || steps.ghc-wasm-setup.outcome == 'skipped'
7473
run: wasm32-wasi-cabal update
7574

76-
- name: Install native utilities
75+
- name: Install native utilities and autotools
7776
run: |
77+
echo ">>> Install autotools for network package"
78+
sudo apt-get update
79+
sudo apt-get install -y autotools-dev autoconf
7880
echo ">>> Update cabal"
7981
~/.ghc-wasm/cabal/bin/cabal update
8082
echo ">>> Install alex and happy"
@@ -109,11 +111,12 @@ jobs:
109111
- name: Build dependencies
110112
working-directory: './als'
111113
run: |
112-
# Setup network submodule autotools
113-
cd wasm-submodules/network
114-
autoreconf -i
115-
cd ../..
116-
# Build all dependencies (cabal git deps + network submodule)
114+
# Run autoreconf on network package source after cabal fetches it
115+
echo ">>> Fetching dependencies first..."
116+
wasm32-wasi-cabal fetch --dependencies-only
117+
echo ">>> Running autoreconf on network package..."
118+
find dist-newstyle/src -name "network-*" -type d | head -1 | xargs -I{} sh -c 'cd {} && autoreconf -i'
119+
echo ">>> Building all dependencies..."
117120
wasm32-wasi-cabal build --dependencies-only
118121
119122
- name: Build als

.gitmodules

Lines changed: 0 additions & 4 deletions
This file was deleted.

BUILDING_WASM.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +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`.
65

7-
Note: This project uses a hybrid approach - most dependencies use cabal's git handling, but the network package remains as a git submodule due to autotools requirements.
6+
Note: This project uses cabal's `source-repository-package` declarations to fetch git dependencies instead of git submodules.
87

98
The process might output the following:
109

cabal.project

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
packages:
22
.
3-
wasm-submodules/network
43

54
source-repository-package
65
type: git

cabal.project.wasm32

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
packages:
22
.
3-
wasm-submodules/network
43

54
source-repository-package
65
type: git
@@ -24,5 +23,10 @@ source-repository-package
2423
tag: 9baf76e6d9965a3b6e8b3ecfcdf33c62b5628fd8
2524
subdir: lsp-types
2625

26+
source-repository-package
27+
type: git
28+
location: https://github.com/haskell-wasm/network.git
29+
tag: 1dc870889eee4ac733335ced4e274b4dfe8ed369
30+
2731
package Agda
2832
flags: +optimise-heavily

wasm-submodules/network

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)