Repository navigation
Commit 688c190
committed
add ghcXX-minimal-ghc-web flavor: wasm + JS backend dev tooling
The wasm and JavaScript backends need a small set of dev-time tools
that aren't part of a stock Haskell shell:
* nodejs_22 — required for utils/jsffi/post-link.mjs (uses
import.meta.filename added in Node 20.11; Ubuntu's
apt nodejs is 18.x and silently breaks the post-link
step) and for JSFFI host execution at test time
* wabt — wasm-objdump for inspecting custom sections (e.g.
detecting ghc_wasm_jsffi imports) in wasm modules
* wasmtime — pure-WASI runtime, when a wasm module has no JSFFI
imports and can run standalone
* emscripten — the JavaScript backend's C toolchain (emcc / em++ /
emar / emnm / emranlib / emstrip)
Currently downstream consumers (e.g. stable-haskell/ghc's wasm
cross-compiler CI) bootstrap these per-platform via apt + NodeSource +
nix-env + curl installers, plus PATH workarounds for devx scrubbing
/usr/bin. Shipping them in the flavor collapses ~70 lines of
platform-shell to one `shell:` line in user workflows.
Deliberately NOT bundled: wasi-sdk. Its version needs to match the
wasm32-wasi-ghc cross-compiler bundle that ghc-wasm-meta
(https://gitlab.haskell.org/ghc/ghc-wasm-meta) owns, so keeping that
pin in ghc-wasm-meta avoids version drift across two trees. Users
still bootstrap wasi-sdk via ghc-wasm-meta for wasm32-wasi builds.
Closure cost on aarch64-darwin (paired with the prior trim commit):
ghc98-minimal-ghc (current master) : 6.12 GB
ghc98-minimal-ghc (after trim PR) : 4.00 GB (-2.12 GB)
ghc98-minimal-ghc-web (this commit) : 5.99 GB (+1.99 GB)
Net: the web flavor with the full toolchain ends up SMALLER than the
current untrimmed minimal-ghc, because the trim commit removed
ghc-9.10.3 and emscripten's LLVM/apple-sdk now dedupes against the
shell's base nixpkgs pin (no version fragmentation).
Comfortably under the 10 GB GitHub Actions per-repo cache cap on
both Darwin and Linux (Linux delta is similar magnitude — emscripten
+ closure-compiler are the heavy hitters on both).
Verified inside the patched shell:
$ ghc --version # 9.8.4
$ cabal --version # 3.17.0.0
$ happy --version # 2.1.7
$ alex --version # 3.5.4.0
$ git --version # 2.51.2 (gitMinimal)
$ node --version # v22.21.1
$ wasm-objdump --version # 1.0.37
$ wasmtime --version # 38.0.3
$ emcc --version # 4.0.12-git
All on the expected store paths.1 parent f683299 commit 688c190
2 files changed
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
157 | 179 | | |
158 | 180 | | |
159 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
228 | 232 | | |
229 | 233 | | |
230 | 234 | | |
| |||
0 commit comments