-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
What problem does this solve or what need does it fill?
Newly in Bevy 0.17, bevy_platform
depends on getrandom 0.3
, solely for the purpose of enabling the wasm_js
feature. This means that all dependents of bevy_platform
compiling for the web must do the RUSTFLAGS=--cfg
thing, even if they are not using getrandom
anywhere else at all — such as if they using bevy_ecs
but not bevy_math
.
It would be nice if users of bevy_ecs
alone did not have to deal with rustflags configuration, since it composes poorly — for example, RUSTFLAGS=-Dwarnings
, such as one might do in CI, will overwrite the configuration.
(Also, from a build performance perspective, it's an unnecessary dependency on getrandom
.)
What solution would you like?
One of:
- Remove this dependency on
getrandom
entirely — obligate application developers to have a dep and arustflags
config instead of just a dep. This would be a breaking change, so it can't happen for 0.17. - Move the dependency on
getrandom
somewhere more root-ward in the dependency graph ofbevy
, such asbevy_math
. This might manage to not be a breaking change, at least for users ofbevy
as a whole, but I don’t know if the overall dependency graph is such that this is possible.
What alternative(s) have you considered?
Do nothing; continue to obligate all users of bevy_ecs
to depend on getrandom
and do the configuration.
Additional context
I regret not having noticed this issue — or at least, not having thought to check whether it would be possible to fix as opposed to necessary to live with — sooner so as to report it in the release candidate period.