Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm compile error with rhai #260

Open
yorqat opened this issue Feb 9, 2025 · 5 comments
Open

Wasm compile error with rhai #260

yorqat opened this issue Feb 9, 2025 · 5 comments

Comments

@yorqat
Copy link

yorqat commented Feb 9, 2025

Running trunk serve shows this doesn't seem to matter which features I use because I set default features false anyway and only use the rhai feature. Does bevy_mod_scripting rely on this bevy_asset feature?

2025-02-09T11:05:58.247667Z  INFO 📦 starting build
   Compiling bevy_asset v0.15.2
   Compiling gilrs v0.11.0
   Compiling accesskit_winit v0.23.1
   Compiling bevy_state v0.15.2
error: The "file_watcher" feature for hot reloading does not work on Wasm.
       Disable "file_watcher" when compiling to Wasm
 --> /home/qat/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_asset-0.15.2/src/io/mod.rs:2:1
  |
2 | / compile_error!(
3 | |     "The \"file_watcher\" feature for hot reloading does not work \
4 | |     on Wasm.\nDisable \"file_watcher\" \
5 | |     when compiling to Wasm"
6 | | );
  | |_^

   Compiling instant v0.1.13
   Compiling thin-vec v0.2.13
   Compiling rhai v1.21.0
error: could not compile `bevy_asset` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
2025-02-09T11:07:01.403243Z ERROR ❌ error
error from build pipeline

Caused by:
    0: HTML build pipeline failed (1 errors), showing first
    1: error from asset pipeline
    2: running cargo build
    3: error during cargo build execution
    4: cargo call to executable 'cargo' with args: '["build", "--target=wasm32-unknown-unknown", "--manifest-path", "/h
ome/qat/tyconia/Cargo.toml"]' returned a bad status: exit status: 101
@makspll
Copy link
Owner

makspll commented Feb 9, 2025

Hi yes WASM is not supported currently, and yes BMS core does depend on bevy_asset

@makspll
Copy link
Owner

makspll commented Feb 9, 2025

this is tracked under #166

@yorqat
Copy link
Author

yorqat commented Feb 9, 2025

this is tracked under #166

I thought that issue pertains to mlua not having a wasm32-unknown-unknown target whilst this one is with rhai

Is this an upstream issue with bevy_asset or file watcher? I think I'm missing something

@makspll
Copy link
Owner

makspll commented Feb 9, 2025

I thought that issue pertains to mlua not having a wasm32-unknown-unknown target whilst this one is with rhai

No you're right this is a different issue related to WASM support, what I mean is that this crate hasn't been tested against WASM at all, so I am lumping all of the issues together as a generic "compile for WASM" request.

Is this an upstream issue with bevy_asset or file watcher? I think I'm missing something

It looks like yes, file watcher cannot be enabled while compiling to WASM. However if BMS is enabling that flag, I do not plan on tackling WASM compat until after re-working doc-gen features, unless someone else has a look

@makspll
Copy link
Owner

makspll commented Feb 23, 2025

FYI I was cleaning up bevy features, and looks like I'll be getting rid of that feature flag anyway in #316

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants