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

Compiler error when using profile-with-tracing with wgpu-core #21

Closed
Shfty opened this issue Jun 7, 2021 · 1 comment · Fixed by #22
Closed

Compiler error when using profile-with-tracing with wgpu-core #21

Shfty opened this issue Jun 7, 2021 · 1 comment · Fixed by #22

Comments

@Shfty
Copy link

Shfty commented Jun 7, 2021

wgpu-core uses profiling for instrumentation, and fails to compile if a downstream crate enables the profile-with-tracing feature on a local profiling dependency.

Repro steps

  • cargo init wgpu-error
  • Add a wgpu-core = "0.8.1" dependency to Cargo.toml
  • Add a profiling = { version = "1.0.1", features = ["profile-with-tracing"] } dependency to Cargo.toml
  • cargo build

This results in a lengthy set of compiler errors, the most prominent of which is failed to resolve: use of undeclared crate or module 'tracing' on each invocation of the profiling::scope macro, and expected type parameter 'B', found struct 'profiling::tracing::level_filters::LevelFilter' where the macro is invoked in a generic context.

The other feature flags don't exhibit this issue. Adding a tracing dependency to the wgpu-error binary crate causes the same outcome, as does using version = "1" for profiling to match its entry in the wgpu-core Cargo.toml, so this doesn't appear to be a local dependency or version mismatch issue.

Given that the tracing dependency is present in profiling as a re-export, and that its presence in wgpu-error makes no difference, I suspect that $crate is actually resolving to the nonexistent wgpu-core::tracing due to some quirk with macro expansion.

Relevant wgpu-core issue:
gfx-rs/wgpu#1477

@aclysma
Copy link
Owner

aclysma commented Jun 9, 2021

Published as 1.0.2

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

Successfully merging a pull request may close this issue.

2 participants