Error message "Couldn't find a target code interpreter" when building
Platform
wsl (Ubuntu) on Windows 11, but I don't think the platform matters
Steps to reproduce
- Clone source code from !46 (Anut-py/ghc-wasm-meta master)
- This MR bumps the cabal version to be compatible with ghc 9.8
- Run
FLAVOUR=9.8 ./setup.sh
- Clone source code from Anut-py/h-raylib web (github)
- Run
source ~/.ghc-wasm/env
- Run
wasm32-wasi-cabal build basic-window --constraint="h-raylib -detect-platform +platform-web"
- If it fails to build a dependency, just run the command again (this is probably another issue with ghc-wasm-meta)
- Run
Error
It will fail with the following error message:
<no location info>: error:
Couldn't find a target code interpreter. Try with -fexternal-interpreter
Error: cabal: Failed to build exe:basic-window from h-raylib-5.1.0.1.
Obviously -fexternal-interpreter
is not an option because wasm32-wasi-ghc
doesn't come with ghc-iserv
. I have made a very similar project in the past, and that compiled fine with ghc-wasm-meta. The only major difference is that this project uses Template Haskell, which I think is the cause of the problem.