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

Building wgpu client with trace enabled for wasm fails #1619

Closed
blakej11 opened this issue Jul 9, 2021 · 4 comments
Closed

Building wgpu client with trace enabled for wasm fails #1619

blakej11 opened this issue Jul 9, 2021 · 4 comments
Labels
help required We need community help to make this happen. type: bug Something isn't working

Comments

@blakej11
Copy link

blakej11 commented Jul 9, 2021

Description
I have a project based on current wgpu (commit e27fbb8). When building it for wasm, I compile it with RUSTFLAGS=--cfg=web_sys_unstable_apis cargo build --no-default-features --target wasm32-unknown-unknown. When I try to build it with the "trace" feature enabled in its wgpu dependency, it fails while trying to build libloading 0.7.0; the errors are of the form:

error[E0433]: failed to resolve: use of undeclared crate or module `imp`
  --> /Users/blakej/.cargo/registry/src/github.com-1ecc6299db9ec823/libloading-0.7.0/src/lib.rs:63:20
   |
63 | pub struct Library(imp::Library);
   |                    ^^^ use of undeclared crate or module `imp`

The problem is presumably that libloading is being compiled at all, which doesn't seem to make sense for a wasm target.

I wasn't able to figure out exactly what was inducing it to be compiled, but I noticed that if I removed the "wgc/trace" entry in the trace feature in wgpu/wgpu/Cargo.toml (in a local copy of wgpu), it stopped trying to pull in that dependency.

Platform
macOS 11.4, wgpu snapshot listed above.

@kvark kvark added help required We need community help to make this happen. type: bug Something isn't working labels Jul 9, 2021
@kvark
Copy link
Member

kvark commented Jul 9, 2021

Hmm, nothing obvious here:

trace = ["ron", "serde", "wgt/trace", "arrayvec/serde", "naga/serialize"]

At the same time, trace feature isn't usable in wasm at all, so this isn't a blocker for anyone.

@RodogInfinite
Copy link

I got the same issue when trying to run the examples on the web with a local copy of this repo. It looks like this might be solved with libloading 0.7.2 according to Fails to build to wasm32-unknown-unknown target #91 . I'm not sure where exactly the solution should be implemented though since I'm just getting started by running examples.

@kvark
Copy link
Member

kvark commented Mar 4, 2022

we could just require libloading 0.7.2 in the dependencies (instead of 0.7)

@teoxoy
Copy link
Member

teoxoy commented Feb 28, 2023

There has recently been some work improving which features get enabled depending on platform.

@blakej11 @RodogInfinite is this still an issue on current master (try forcing libloading 0.7.0)?

@teoxoy teoxoy closed this as completed Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help required We need community help to make this happen. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants