Skip to content

Chore/bevy 0.17#399

Merged
anderspitman merged 39 commits intomainfrom
chore/bevy-0.17
Jan 20, 2026
Merged

Chore/bevy 0.17#399
anderspitman merged 39 commits intomainfrom
chore/bevy-0.17

Conversation

@anderspitman
Copy link
Contributor

No description provided.

@anderspitman anderspitman marked this pull request as draft January 9, 2026 21:41
Copy link
Contributor Author

@anderspitman anderspitman left a comment

Choose a reason for hiding this comment

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

@shanecelis @zxq82lm I did a bit of a pre-review leaving some comments to explain a few things. Here's the bevy migration guide for reference:

https://bevy.org/learn/migration-guides/0-16-to-0-17/

Note that this is ready for review even though clippy is broken. See comment about WINIT_WINDOWS below.

Another thing to be aware of is this brought some changes to macOS that I'm unable to test locally.

When testing, I recommend especially banging on the viewport, and trying out all our widgets. These changes affect pretty much everything.

match self {
LabelSource::Label(l) => l.clone(),
LabelSource::System(system) => system.run(filter, world),
LabelSource::System(system) => system.run(filter, world).expect("Missing label"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This matches the old behavior, which would panic. We may want to handle explicitly.

See https://bevy.org/learn/migration-guides/0-16-to-0-17/#system-run-returns-result

cam.hdr = hdr_enabled.0;
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is fine. It'll work but I feel like we could add some qualifiers like Added<Camera>, and checking whether HdrEnabled.is_changed() could be used to opt out early. But our camera number is a handful and it doesn't do anything in the loop that isn't necessary, so again it's fine.

self.prompt = Some(prompt.to_string());
self
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of the into_event calls are using the method below.

use objc2::{ClassType, msg_send, msg_send_id};
use objc2_app_kit::{NSColor, NSToolbar, NSWindow, NSWindowStyleMask, NSWindowToolbarStyle};

WINIT_WINDOWS.with_borrow(|winit_windows| {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

WINIT_WINDOWS replaces the old WinitWindows resource, using a scoped function now. This indents a lot of code that otherwise hasn't changed. What I'm doing for now is not indenting properly. clippy will complain, but it makes a lot less code to review. Once review is done I'll push the indentation changes.

}
}

fn init_line_pipeline(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

let logo_full = state
.contexts
.add_image(state.images.logo_full.clone_weak());
.add_image(EguiTextureHandle::Weak(state.images.logo_full.id()));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anderspitman anderspitman marked this pull request as ready for review January 14, 2026 19:44
@shanecelis
Copy link
Collaborator

shanecelis commented Jan 15, 2026

This looks pretty great, Anders! I did find a small issue on macOS. I fixed it and pushed a commit directly in this branch. I exercised the ball, drone, cube_sat, and three_body, and rocket examples with no problems.

EDIT: Rocket works too.

Copy link
Collaborator

@shanecelis shanecelis left a comment

Choose a reason for hiding this comment

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

Looks good!

EDIT: rocket works too.

cam.hdr = hdr_enabled.0;
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is fine. It'll work but I feel like we could add some qualifiers like Added<Camera>, and checking whether HdrEnabled.is_changed() could be used to opt out early. But our camera number is a handful and it doesn't do anything in the loop that isn't necessary, so again it's fine.


fn setup_window_icon(
_windows: Query<(Entity, &bevy::window::PrimaryWindow)>,
// this is load bearing, because it ensures that there is at
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a comment I'm sad to see go just because it looks like it's trying to prevent an accidental removal. Is it still true? It looks like it's not true any longer. Is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was torn on this too. Originally I had actually added an additional comment. When I looked closer I assumed that !_windows.is_empty() would be enough to ensure a window, but maybe not. It's also unclear why both parameters start with an underscore. We could defensively trust in Chesterton's Fence and keep using WINIT_WINDOWS here, or we could yolo and see if we ever have issues with random crashes on startup. I don't think that would be particularly hard to debug if it happened. I'm good either way, so your call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just realized my thinking _windows might be sufficient makes no sense, because it's not even used for macOS. I vote we defensively use WINIT_WINDOWS with an even more verbose comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shanecelis I just pushed the closest port I can come up with for the old behavior, along with a comment. If it looks good to you and you wouldn't mind verifying that it doesn't break macOS, I think we can resolve this.

@anderspitman
Copy link
Contributor Author

@shanecelis only had one followup question. Once that resolved I'll push a new commit that does nothing other than clippy/fmt.

@shanecelis
Copy link
Collaborator

It's working on macOS, but I am seeing this strange thing in the rocket example:

Screenshot 2026-01-15 at 10 01 15 AM

@shanecelis
Copy link
Collaborator

Uh oh.

uh-oh.mov

@anderspitman
Copy link
Contributor Author

anderspitman commented Jan 15, 2026

Well that's weird. I'm seeing the panes not close properly on main as well, but the shared ID thing is unique to my branch.

How did you get that nice warning widget about the IDs?

After updating to bevy 0.17 we noticed that two of the plots
on the rocket example had lock icons that were tied together, due
to sharing the same egui ID. This is because we were
generating the IDs from the raw pointer of the graph_state, and
apparenting something about the bevy 0.17 changes is causing the
address to be reused.

This commit switches to using the bevy Entity as the seed for the
egui ID, which should remain stable for as long as the plot
exists.
@shanecelis
Copy link
Collaborator

I didn't do anything special to get the warning. I'm just lucky I guess. :)

@anderspitman anderspitman merged commit d24a331 into main Jan 20, 2026
11 checks passed
@anderspitman anderspitman deleted the chore/bevy-0.17 branch January 20, 2026 01:07
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

Comments