Skip to content

Commit

Permalink
Add HTML5 limitations section and relevant errors
Browse files Browse the repository at this point in the history
  • Loading branch information
necrashter authored and chitoyuu committed Jan 31, 2023
1 parent e0789ef commit 9da0af7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gdnative/export/html5.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Emscripten uses a cache to store build artifacts and header files. This means th

Also note that `wasm32-unknown-emscripten` is a 32-bit target, which can cause problems with crates incorrectly assuming that `usize` is 64 bits wide.

### Limitations

* Multi-threading is not supported. See [this issue](https://github.com/godot-rust/gdnative/issues/1022) for more details and instructions for failing experimental build.
* Debug builds may not work due to their large size. See [the corresponding issue](https://github.com/godot-rust/gdnative/issues/1021).
* As a workaround, you can set `opt-level = 1` in debug builds, which reduces the build size. Add the following to your workspace's/project's `Cargo.toml`:
```toml
[profile.dev]
opt-level = 1
```

## Godot 3.5

**Disclaimer**: _Currently, the following steps are only tested and confirmed to work on Linux._
Expand Down Expand Up @@ -132,6 +142,8 @@ Runtime:
* `need the dylink section to be first`: Same as above
* `WebAssembly.Module(): Compiling function #1 failed: invalid local index`: You need to build with `-Cpanic=abort`
* `ERROR: Can't resolve symbol godot_gdnative_init. Error: Tried to lookup unknown symbol "godot_gdnative_init" in dynamic lib`: Possibly because Emscripten version is not compatible with Rust toolchain version. See the compatible version list above.
* `wasm validation error: at offset 838450: too many locals`: Binary size is too big. See [limitations](#limitations) section for a workaround.
* `WebAssembly.instantiate(): Compiling function #2262:"gdnative_sys::GodotApi::from_raw::..." failed: local count too large`: Binary size is too big. See [limitations](#limitations) section for a workaround.

### Further reading

Expand Down

0 comments on commit 9da0af7

Please sign in to comment.