I’m trying to compile a project (GitHub - disco-lang/disco: Functional teaching language for use in a discrete mathematics course) to WASM, using haskell-wasm / ghc-wasm-meta · GitLab (GHC 9.10 flavour). Currently, however, compilation fails with this error:
$ wasm32-wasi-cabal build disco:exe:disco-wasm
...
Error: [Cabal-7125]
Failed to build polysemy-1.9.2.0 (which is required by exe:disco-wasm from disco-0.1.6). The failure occurred during the configure step. The exception was:
/home/brent/.ghc-wasm/.cabal/logs/ghc-9.10.1.20241209/polysemy-1.9.2.0-0b93fd0a5b67d6e748c11008a1c7656674bcd3afd2bf6398a6adf44f221541b2.log: withFile: user error (Error: cabal: '/home/brent/.ghc-wasm/wasm32-wasi-ghc/bin/wasm32-wasi-ghc'
exited with an error:
wasm-ld: error: unable to find library -lHSrts-1.0.2_thr
wasm32-wasi-clang: error: linker command failed with exit code 1 (use -v to
see invocation)
wasm32-wasi-ghc-9.10.1.20241209: `wasm32-wasi-clang' failed in phase `Linker'.
(Exit code: 1)
)
Any ideas on how to get around this? Or is the polysemy dependency a no-go?
The branch where I’m working on this is here: GitHub - disco-lang/disco at web-ui