You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then it is necessary to get `ghc` for wasm, and you see how to do that [here](https://gitlab.haskell.org/haskell-wasm/ghc-wasm-meta#getting-started-without-nix). At the moment, it is necessary to install a version of `ghc` that has `base <= 4.20`, so I would recommend installing `wasm32-wasi-9.10` like this:
And finally we write an entry for `pkgconfig`, so that later `ghc` can find our prefix:
80
80
81
-
```
81
+
```bash
82
82
cat <<EOF > $HOME/prefix/lib/pkgconfig/libblst.pc
83
83
prefix=$HOME/prefix
84
84
exec_prefix=\${prefix}
@@ -98,21 +98,21 @@ EOF
98
98
99
99
Finally we leave the folder:
100
100
101
-
```console
101
+
```bash
102
102
cd ..
103
103
```
104
104
105
105
#### Installing `libsodium`
106
106
107
107
We can also obtain `libsodium` from its website [here](https://libsodium.org). We can use `wget` to get the source code for one of its releases. For example:
@@ -205,6 +205,54 @@ You can find more information in [this url](https://ghc.gitlab.haskell.org/ghc/d
205
205
206
206
And you can find an example of how to use it in the `example` subfolder. This example assumes that the generated `.wasm` and `.js` files as well as the files from the `lib-wrapper` subfolder, all reside in the same folder as the code in `example` subfolder.
207
207
208
+
### Troubleshooting guide
209
+
210
+
#### `Failed to load dynamic interface file for ...` GHC-47808 error
211
+
212
+
When you're seeing an error similar to:
213
+
```console
214
+
[1 of 4] Compiling Data.Constraint.Compose ( src/Data/Constraint/Compose.hs, dist/build/Data/Constraint/Compose.o, dist/build/Data/Constraint/Compose.dyn_o )
Failed to load dynamic interface file for Data.Constraint:
217
+
Exception when reading interface file /home/mgalazyn/.local/share/cabal/store/ghc-9.10.1.20250327-inplace/constraints-0.14.2-7fc45a1b31889530ee7f295fd8bc8535f521e6eaac4bbc3cc5df34e174a5eacf/lib/Data/Constraint.dyn_hi
218
+
/home/mgalazyn/.local/share/cabal/store/ghc-9.10.1.20250327-inplace/constraints-0.14.2-7fc45a1b31889530ee7f295fd8bc8535f521e6eaac4bbc3cc5df34e174a5eacf/lib/Data/Constraint.dyn_hi: withBinaryFile: does not exist (No such file or directory)
219
+
|
220
+
14 | import Data.Constraint
221
+
| ^^^^^^^^^^^^^^^^^^^^^^
222
+
```
223
+
224
+
Most likely the reason is that `cabal` store is polluted with non-wasm and/or nix and non-nix package information and `ghc-pkg` is unable to find the right dependencies.
225
+
You can try to isolate `cabal` environment for WASM build from other builds.
226
+
In other words, paths in `cabal path` command output should be different than for other builds.
227
+
228
+
##### When using `nix`
229
+
230
+
Try entering development shell in an isolated environment, and setting `$HOME` to a different directory, making `cabal` use different state directory.
231
+
```bash
232
+
nix develop -i .#wasm
233
+
export HOME=`pwd`# or some other path that you want cabal state in
234
+
wasm32-wasi-cabal update
235
+
wasm32-wasi-cabal build cardano-wasm
236
+
```
237
+
238
+
#### Cabal error Cabal-7125 `Failed to download ... The exception was: user error (https not supported)`
239
+
240
+
This can happen when using `nix develop -i`. To work around that add to your `cabal.project.local`:
241
+
242
+
```
243
+
http-transport: curl
244
+
```
245
+
thus making `cabal` use `curl` for HTTP connections instead.
246
+
247
+
#### Build is getting stuck at one of the dependencies
248
+
249
+
It may happen that the build gets stuck on one of the dependencies, and if you check the CPU usage of the compiler process, you'll see a value close to 0.
0 commit comments