bevy
bevy copied to clipboard
Set a minimum rust-version
Objective
Trying to compile Bevy on Rust 1.61 or below causes compile errors because deriving 'Default' on enums is experimental, which is confusing to users who don't realize that they need to update their toolchain to fix it.
Solution
Set rust-version = 1.62 so that Cargo gives a clearer error.
This is controversial because, as discussed in #288, we follow a "latest stable Rust" policy and this would need to be constantly manually updated. I've made a prominent note in the readme in https://github.com/bevyengine/bevy/pull/4274, but perhaps we could do better.
Understandable, but there's a reasonable amount of users who get into Rust and Bevy at the same time, so I think it makes sense to make it clearer for them. (That said, I only noticed a handful of users on Discord get confused by the error, so maybe it's not that common.)
... also, I completely missed that message in the README, whoops. 😅 I haven't had reason to look at it in a while.
Understandable, but there's a reasonable amount of users who get into Rust and Bevy at the same time
I agree, but a) they typically just download the latest Rust and b) they won't know to look for an MSRV :)
b) they won't know to look for an MSRV :)
Cargo refuses to run if the local Rust version is not recent enough, with a more explicit message than the usual "hey you're using nightly features on stable"
Maybe we could have the field... but I would like to avoid PR just updating that field because another PR that introduced a dependency on a newer version of Rust forgot to update it. That would mean adding a job to CI actually checking that version
Error message like in https://github.com/bevyengine/bevy/issues/5520 is so confusing for someone not used to them
Is there really a need to worry about this on main?
I would expect this to affect people using bevy from crates.io the most and I don't see a downside to updating the rust-version to the latest stable before each Bevy release.
Maybe as a part of the automatic PR that bumps the version of all bevy crates.
It would be nice to add this to the 0.8.1 milestone.
If we add the field in the Cargo.toml, its value must be true. Updating it only on release means it would sometimes be false on main, which is not good.
It's still possible to remove the line after release during development and adding it back with a new rust version just before releasing a new version.
Closing in favor of #6852, which automates this further.