Skip to content

Migrating to bevy 0.19. - #128

Merged
idanarye merged 8 commits into
idanarye:mainfrom
martinfrances107:MigrateBevy0p19
Jun 22, 2026
Merged

Migrating to bevy 0.19.#128
idanarye merged 8 commits into
idanarye:mainfrom
martinfrances107:MigrateBevy0p19

Conversation

@martinfrances107

@martinfrances107 martinfrances107 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Initial version just changing version in various Cargo.toml files.

@martinfrances107

Copy link
Copy Markdown
Contributor Author

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",
@martinfrances107

Copy link
Copy Markdown
Contributor Author

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
@martinfrances107

Copy link
Copy Markdown
Contributor Author

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
( this escosyem is so inter-connected it always takes a few weeks for things to shake out )

@martinfrances107

Copy link
Copy Markdown
Contributor Author

Not my work but the avian migration this is nearly complete

avianphysics/avian#991

@idanarye

Copy link
Copy Markdown
Owner

This is why I never even start upgrading this crate before either Avian or Rapier upgrade to the new Bevy.

@martinfrances107

Copy link
Copy Markdown
Contributor Author

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 removes much of the compile error shown by cargo test

This allowed me to see more fixes here.

@martinfrances107

Copy link
Copy Markdown
Contributor Author

Progress - cargo test now passes.

I am putting in pause in here

  • Wait for avain2d/3d to publish an release, so we can removed the hot fix.
  • Changelog needs to be updated etc

@martinfrances107

martinfrances107 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Just reviewing my own work - stripping the patch back to what is needed.

removed unwanted calls to .into()

@martinfrances107

Copy link
Copy Markdown
Contributor Author

avian2d/avian3d has now published 0.7 removed hot fix.

I am currently focusing on the Changelog

@martinfrances107

Copy link
Copy Markdown
Contributor Author

I am still working on this, but

@idanarye -- would you like me to roll up / merge these multiple changes up into a single commit ?

@martinfrances107

Copy link
Copy Markdown
Contributor Author

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.

@idanarye

Copy link
Copy Markdown
Owner

@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 idanarye left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::*;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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};

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait what? These are Avian types - why are you importing them from crate?

1,
&[
("Point", |mut cmd| {
("Point", |_cmd| {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The migration guide recommends using .into() here.

Comment thread demos/src/ui/mod.rs
use tuning::UiTunable;

#[derive(SystemSet, Clone, PartialEq, Eq, Debug, Hash)]
#[derive(ScheduleLabel, SystemSet, Clone, PartialEq, Eq, Debug, Hash)]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why? It's not used as a schedule label.
  2. You are only importing ScheduleLabel when the egui feature flag is on, but using it even when it's off. This will fail to build without that flag.

Comment thread demos/Cargo.toml
clap = { version = "^4", features = ["derive"] }
ordered-float = "5.0.0"
serde = { version = "1.0.228", features = ["derive"] }
bevy_ecs = "0.19.0"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't. When you need to import something from bevy_ecs (and you don't) just use the bevy::ecs re-export.

@idanarye

Copy link
Copy Markdown
Owner

I don't want to keep delaying the upgrade, so I'm going to just merge and fix these thing myself.

@idanarye
idanarye merged commit 5b2b5ac into idanarye:main Jun 22, 2026
3 of 8 checks passed
@martinfrances107

Copy link
Copy Markdown
Contributor Author

Thanks for the careful review.. I agree with everything.

I have learned a lot

@martinfrances107
martinfrances107 deleted the MigrateBevy0p19 branch June 23, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants