Migrating to bevy 0.19. - #128
Conversation
|
This does not yet compile .. I am working through the migration guide |
This requires the include of two bevy subcrates + "system_font_discovery", + "bevy_pbr",
|
Fixed some compile errors, more to follow |
2) DirecionLight
- shadows_enabled: true,
+ shadows_maps_enabled: true,
3) SceneRoot
- cmd.insert(SceneRoot(asset_server.load("player.glb#Scene0")));
+ cmd.insert(WorldAsserRoot(asset_server.load("player.glb#Scene0")));
4) Many crate migrated to latest
5)
bevy_rapier2d
bevy_rapier3d
bevy_egui
egui_plot
egui_extra
6)
added bevy_ecs
|
I think I am the point where I need to stop and migrate avain3d the current verison of avian3d is pulling in bevy 0.18 and causing too many conflicts |
|
Not my work but the avian migration this is nearly complete |
|
This is why I never even start upgrading this crate before either Avian or Rapier upgrade to the new Bevy. |
|
avain3d/avain2d has pushed the bevy migration into main So I have placed a "DO NOT COMMIT" hot fix to use the main branch This allowed me to see more fixes here. |
|
Progress - cargo test now passes. I am putting in pause in here
|
|
Just reviewing my own work - stripping the patch back to what is needed. removed unwanted calls to .into() |
|
avian2d/avian3d has now published 0.7 removed hot fix. I am currently focusing on the Changelog |
|
I am still working on this, but @idanarye -- would you like me to roll up / merge these multiple changes up into a single commit ? |
|
I think this is functionally complete... After looking the changes to the various changelogs are best handled separately as part of the release cycle. I don't thing this involved any change to the public API - So have nothing to add to the MIGRATION-GUIDES So I think this PR is complete and ready for review? I will jump on anything that comes up. |
|
@martinfrances107 I prefer a single commit, but I won't insist on it. Do merge master (or, if you squash them, rebase on it) to obtain #130 so I can run the CI on it. I'll try to review it later. |
Picking up changes to .github/workflow/ci.yml Needed because Bevy always moved to the lastest rust toolchain for performance.
idanarye
left a comment
There was a problem hiding this comment.
Lots of these changes seem unrelated. I believe you did some them because of warnings you received when building with no physics backend (because you started before Avian was upgraded)?
Also note that the CI is red.
| @@ -1,5 +1,6 @@ | |||
| use avian2d::prelude::*; | |||
There was a problem hiding this comment.
Why did you remove the prelude import? This is the usual way to do import these things in Rust.
| @@ -1,5 +1,6 @@ | |||
| use avian2d::prelude::*; | |||
| use bevy::{ecs::system::SystemParam, prelude::*}; | |||
| use crate::{Collider, Position, Rotation}; | |||
There was a problem hiding this comment.
Wait what? These are Avian types - why are you importing them from crate?
| 1, | ||
| &[ | ||
| ("Point", |mut cmd| { | ||
| ("Point", |_cmd| { |
There was a problem hiding this comment.
Uh... no? cmd is used inside the closure body. I assume, when you try to build with neither physics backend --features flag the compiler will complain - but the demo would be useless when built that way...
| #[allow(unused)] radius: Float, | ||
| ) -> EntityCommands<'_> { | ||
| let font = self.asset_server.load("FiraSans-Bold.ttf"); | ||
| let font = FontSource::Handle(self.asset_server.load("FiraSans-Bold.ttf")); |
| use tuning::UiTunable; | ||
|
|
||
| #[derive(SystemSet, Clone, PartialEq, Eq, Debug, Hash)] | ||
| #[derive(ScheduleLabel, SystemSet, Clone, PartialEq, Eq, Debug, Hash)] |
There was a problem hiding this comment.
- Why? It's not used as a schedule label.
- You are only importing
ScheduleLabelwhen theeguifeature flag is on, but using it even when it's off. This will fail to build without that flag.
| clap = { version = "^4", features = ["derive"] } | ||
| ordered-float = "5.0.0" | ||
| serde = { version = "1.0.228", features = ["derive"] } | ||
| bevy_ecs = "0.19.0" |
There was a problem hiding this comment.
Please don't. When you need to import something from bevy_ecs (and you don't) just use the bevy::ecs re-export.
|
I don't want to keep delaying the upgrade, so I'm going to just merge and fix these thing myself. |
|
Thanks for the careful review.. I agree with everything. I have learned a lot |
Initial version just changing version in various Cargo.toml files.