i was trying to use bevy on NixOS when i got a build error from alsa-sys. i figured the easiest workaround would be to just disable sound, since i don't need it right now. after manually specifying every default feature except bevy_audio, i reran it.. and still got the same alsa-sys error.
cargo tree -ialsa-sys showed that bevy_internal is still pulling in bevy_audio, but it wasn't clear why.
is there a way to show a tree of which features enable which other features?
that is indeed what i want, although there seems to be a bug in its logic, it shows "default" as the feature flag, even when i have default-features = false.
Try cargo-hackerman, cargo hackerman explain alsa-sys will draw a feature level tree (needs xdot) starting from alsa-sys and going up each feature until it reaches your workspace.
it doesn't have any dependancies other than bevy. i think it's just a bug in cargo (cargo tree doesn't actually use the same resolver logic as the rest of cargo, which can lead to inaccuracies. i'm guessing noone though to test cargo tree --edges features with disabling the default feature, but then re-enabling some of the defaults)
One of the default features is vorbis which depends on bevy_internal/vorbis which depends on bevy_audio/vorbis. Another is android_shared_stdcxx which activates bevy_internal/android_shared_stdcxx which depends on bevy_audio/android_shared_stdcxx.
And this is what cargo tree prints for me with those features enabled:
(As a side note, bevy should probably be updated to use ? syntax for dependency features, so that android_shared_stdcxx would not unconditionally activate bevy_audio.)
This apparently happens because bevy_internal depends on bevy_audio without disabling its default features, so bevy audio feature "default" is attributed to the bevy_internal package itself, while it would be more useful to attribute it only to bevy_internal feature "bevy_audio".