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 Won't Compile with bevy_log #3099

Closed
billyb2 opened this issue Nov 10, 2021 · 6 comments
Closed

WASM Won't Compile with bevy_log #3099

billyb2 opened this issue Nov 10, 2021 · 6 comments
Labels
C-Bug An unexpected or incorrect behavior C-Dependencies A change to the crates that Bevy depends on P-High This is particularly urgent, and deserves immediate attention

Comments

@billyb2
Copy link
Contributor

billyb2 commented Nov 10, 2021

Bevy version

f4cfcc0

Operating system & version

Arch Linux

What you did

cargo build --target wasm32-unknown-unknown -Zunstable-options -Zbuild-std=panic_abort,std
It compiles fine until it reaches bevy_log:

error[E0277]: the trait bound `WASMLayer: __tracing_subscriber_Layer<Layered<EnvFilter, Registry>>` is not satisfied
   --> /home/billy/.cargo/git/checkouts/bevy-f7ffde730c324c74/f4cfcc0/crates/bevy_log/src/lib.rs:135:46
    |
135 |               let subscriber = subscriber.with(tracing_wasm::WASMLayer::new(
    |  _________________________________________----_^
    | |                                         |
    | |                                         required by a bound introduced by this call
136 | |                 tracing_wasm::WASMLayerConfig::default(),
137 | |             ));
    | |_____________^ the trait `__tracing_subscriber_Layer<Layered<EnvFilter, Registry>>` is not implemented for `WASMLayer`

error[E0277]: the trait bound `WASMLayer: __tracing_subscriber_Layer<Layered<EnvFilter, Registry>>` is not satisfied
   --> /home/billy/.cargo/git/checkouts/bevy-f7ffde730c324c74/f4cfcc0/crates/bevy_log/src/lib.rs:138:65
    |
138 |             bevy_utils::tracing::subscriber::set_global_default(subscriber)
    |             --------------------------------------------------- ^^^^^^^^^^ the trait `__tracing_subscriber_Layer<Layered<EnvFilter, Registry>>` is not implemented for `WASMLayer`
    |             |
    |             required by a bound introduced by this call
    |
    = note: required because of the requirements on the impl of `bevy_utils::tracing::Subscriber` for `Layered<WASMLayer, Layered<EnvFilter, Registry>>`
note: required by a bound in `bevy_utils::tracing::subscriber::set_global_default`
   --> /home/billy/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-0.1.29/src/subscriber.rs:41:8
    |
41  |     S: Subscriber + Send + Sync + 'static,
    |        ^^^^^^^^^^ required by this bound in `bevy_utils::tracing::subscriber::set_global_default`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `bevy_log` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed

What you expected to happen

For it to compile

What actually happened

A build failure

Additional information

@billyb2 billyb2 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 10, 2021
@NiklasEi
Copy link
Member

NiklasEi commented Nov 10, 2021

Quick fix: cargo update -p tracing-wasm --precise 0.2.0

See Discord message with the same issue: https://discord.com/channels/691052431525675048/750833140746158140/907077223960432710

@alice-i-cecile alice-i-cecile added C-Dependencies A change to the crates that Bevy depends on P-High This is particularly urgent, and deserves immediate attention and removed S-Needs-Triage This issue needs to be labelled labels Nov 10, 2021
@mockersf
Copy link
Member

should be fixed on main by #3102, but it's still an issue on 0.5

@billyb2
Copy link
Contributor Author

billyb2 commented Nov 11, 2021

Thank you! I've been using the main branch. Should i keep this issue open?

@mockersf
Copy link
Member

Please keep it open until a decision has been made for 0.5

ponju added a commit to ponju/bevy_wasm2d-5-labo that referenced this issue Nov 15, 2021
@ponju
Copy link

ponju commented Nov 16, 2021

Sorry, I don't know why my repository reference appeared on the timeline.
Please ignore my reference.
The commit message on my project never help anybody.

I was on the same trouble ,too.
And NiklasEi' solution works!
Everything is fine now.

@alice-i-cecile
Copy link
Member

Closing as fixed by #3102.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug An unexpected or incorrect behavior C-Dependencies A change to the crates that Bevy depends on P-High This is particularly urgent, and deserves immediate attention
Projects
None yet
Development

No branches or pull requests

5 participants