-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
bevy_platform depends on getrandom but doesn't need to #21336
Copy link
Copy link
Closed
Labels
A-MathFundamental domain-agnostic mathematical operationsFundamental domain-agnostic mathematical operationsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Milestone
Metadata
Metadata
Assignees
Labels
A-MathFundamental domain-agnostic mathematical operationsFundamental domain-agnostic mathematical operationsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Type
Fields
Give feedbackNo fields configured for issues without a type.
What problem does this solve or what need does it fill?
Newly in Bevy 0.17,
bevy_platformdepends ongetrandom 0.3, solely for the purpose of enabling thewasm_jsfeature. This means that all dependents ofbevy_platformcompiling for the web must do theRUSTFLAGS=--cfgthing, even if they are not usinggetrandomanywhere else at all — such as if they usingbevy_ecsbut notbevy_math.It would be nice if users of
bevy_ecsalone 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:
getrandomentirely — obligate application developers to have a dep and arustflagsconfig instead of just a dep. This would be a breaking change, so it can't happen for 0.17.getrandomsomewhere more root-ward in the dependency graph ofbevy, such asbevy_math. This might manage to not be a breaking change, at least for users ofbevyas 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_ecsto depend ongetrandomand 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.