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

debug_assertions not supported for selecting dependencies and will not work as expected #874

Open
BlinkyStitt opened this issue Apr 14, 2024 · 1 comment

Comments

@BlinkyStitt
Copy link

BlinkyStitt commented Apr 14, 2024

I'm following these docs: https://github.com/RustAudio/cpal/wiki/Setting-up-a-new-CPAL-WASM-project

I added this to my Cargo.toml

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so it's only enabled
# in debug mode.
[target."cfg(debug_assertions)".dependencies]
console_error_panic_hook = "0.1.5"

But it gives this warning:

warning: Found `debug_assertions` in `target.'cfg(...)'.dependencies`. This value is not supported for selecting dependencies and will not work as expected. To learn more visit https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies

Sadly, that doc says "There is currently no way to add dependencies based on these configuration values."

I think a feature needs to be used instead.

@est31
Copy link
Member

est31 commented Apr 19, 2024

Yeah fair point, this needs to be a feature. PRs welcome.

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