-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fix wasm builds with file_watcher enabled #10589
Conversation
Repro steps:
|
Add "Fixes #10507" to the PR description please. Now the difficult question. Is this what we want? What's the problem with failing to compile invalid code? The proposed solution of having hot-reloading silently become broken on WASM targets seems far from ideal. When a user compiles their game with the Here is a suggestion: #[cfg(all(feature = "file_watcher", target_arch = "wasm32"))]
compile_error!(
"The \"file_watcher\" feature for hot reloading does not work \
on WASM.\nDisable \"file_watcher\" (or \"embedded_watcher\") \
when compiling to WASM"
); Question: does this print the error message when trying to compile with the setup you describe? If so I think it might be preferable. What's the issue with the failing compilation? That it is unclear how to fix it? If so, the |
This reverts commit 2f9a82f.
@nicopap I did not about this macro, it's great! So I did remove most of the changes and added the macro. One thing that I left is I still disabled notify-debouncer-full dependency, so it is not compiled on wasm. I did it because without that change, it does not even get to the macro compilation and error is not obvious:
And now on my branch it fails nicely:
You guessed the point of the change, right- I just want to make clear what build is failing if it has to fail. |
Add "Fixes #10507" to the PR description please. So that the issue gets automatically closed. You can click on the … on the top left of your PR description, and there should be an "Edit" option. |
This seems completely non-breaking, as we still have the same behavior, just a different compilation error message. So I think it's a candidate for 0.12.1 |
Description updated |
# Objective - Currently, in 0.12 there is an issue that it is not possible to build bevy for Wasm with feature "file_watcher" enabled. It still would not compile, but now with proper explanation. - Fixes #10507 ## Solution - Remove `notify-debouncer-full` dependency on WASM platform entirely. - Compile with "file_watcher" feature now on platform `wasm32` gives meaningful compile error. --- ## Changelog ### Fixed - Compile with "file_watcher" feature now on platform `wasm32` gives meaningful compile error.
# Objective - Currently, in 0.12 there is an issue that it is not possible to build bevy for Wasm with feature "file_watcher" enabled. It still would not compile, but now with proper explanation. - Fixes bevyengine#10507 ## Solution - Remove `notify-debouncer-full` dependency on WASM platform entirely. - Compile with "file_watcher" feature now on platform `wasm32` gives meaningful compile error. --- ## Changelog ### Fixed - Compile with "file_watcher" feature now on platform `wasm32` gives meaningful compile error.
Objective
file_watcher
feature fails to build forwasm32
becausenotify-debounder-full
is only for native #10507Solution
notify-debouncer-full
dependency on WASM platform entirely.wasm32
gives meaningful compile error.Changelog
Fixed
wasm32
gives meaningful compile error.