-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Update to Glam 0.30.1 and adopt nostd-libm
feature
#18474
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but CI is dead...
This has significant overlap with #18047 (I should've done more research before opening this PR!) I'll coordinate on that PR first and see if the possible blocker on encase can be resolved. If not, this may need to wait for 0.17 |
probably not for the 0.16, as updating glam comes with other crates to update that are not ready |
Since there are two alternate approaches (either upgrade to 0.30 and then add this feature, or get Glam to release a 0.29.3 with the feature backported) I'm going to close this PR while we see which option presents itself! |
# Objective - Fixes #18397 - Supersedes #18474 - Simplifies 0.16 migration ## Solution - Upgrade to Glam 0.29.3, which has backported the `nostd-libm` feature. - Expose a similar feature in `bevy_math` and enable it in `bevy_internal`, allowing `bevy_math`, `bevy_input`, and `bevy_transform` to be unconditional dependencies again. ## Testing - CI --- ## Notes - This includes `libm` as a dependency, but this was already the case in the common scenario where `rand` or many other features were enabled. Considering `libm` is an official Rust crate, it's a very low-risk dependency to unconditionally include. - For users who do not want `libm` included, simply import Bevy's subcrates directly, since `bevy_math/nostd-libm` will not be enabled. - I know we are _very_ late in the RC cycle for 0.16, but this has a substantial impact on the usability of `bevy` that I consider worth including.
- Fixes #18397 - Supersedes #18474 - Simplifies 0.16 migration - Upgrade to Glam 0.29.3, which has backported the `nostd-libm` feature. - Expose a similar feature in `bevy_math` and enable it in `bevy_internal`, allowing `bevy_math`, `bevy_input`, and `bevy_transform` to be unconditional dependencies again. - CI --- - This includes `libm` as a dependency, but this was already the case in the common scenario where `rand` or many other features were enabled. Considering `libm` is an official Rust crate, it's a very low-risk dependency to unconditionally include. - For users who do not want `libm` included, simply import Bevy's subcrates directly, since `bevy_math/nostd-libm` will not be enabled. - I know we are _very_ late in the RC cycle for 0.16, but this has a substantial impact on the usability of `bevy` that I consider worth including.
Objective
bevy_input
is now optional, but there's no way to enable it #18397bevy
Solution
nostd-libm
featurebevy_math
bevy_math/nostd-libm
inbevy_internal
bevy_math
,bevy_transform
, andbevy_input
inbevy_internal
(reverting to pre-0.16 behaviour)Testing
Notes
This causes
bevy
to always includelibm
as a dependency, but it is a very small and high quality one from the Rust language team themselves. Crucially, thelibm
andstd
features can both override the use ofnostd-libm
, still giving users total control over which implementation they wish to use in both Glam andbevy_math
. I believe the singular forced dependency is worth it for the increased functionality thatdefault-features = false
Bevy can provide.For users who cannot accept that dependency, you can depend directly on Bevy's sub-crates instead, which is generally recommended for enthusiast users anyway.