Skip to content

Fix build error in egui-winit with profiling enabled#7557

Merged
emilk merged 1 commit intoemilk:mainfrom
torokati44:fix-profiling-build-error
Sep 23, 2025
Merged

Fix build error in egui-winit with profiling enabled#7557
emilk merged 1 commit intoemilk:mainfrom
torokati44:fix-profiling-build-error

Conversation

@torokati44
Copy link
Contributor

Fixes #7555.

Verified by patching ruffle to use a checked out egui repo with this change, and running cargo run --release --features=tracy in it.

I hesitated between & and .as_str() - if you'd prefer the latter, let me know.

@github-actions
Copy link

Preview available at https://egui-pr-preview.github.io/pr/7557-fix-profiling-build-error
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@emilk
Copy link
Owner

emilk commented Sep 23, 2025

We should make sure this is caught by CI 🤔

@emilk
Copy link
Owner

emilk commented Sep 23, 2025

I fail to reproduce the problem locally - what command are you running to get a build error?

@torokati44
Copy link
Contributor Author

For example, cargo clippy --workspace --all-features in ruffle-rs/ruffle#21730.

@torokati44
Copy link
Contributor Author

torokati44 commented Sep 23, 2025

The point is to get the profiling/profile-with-tracy feature enabled (possibly an issue with other profile-with-... features too, haven't checked).

@emilk
Copy link
Owner

emilk commented Sep 23, 2025

But the problem doesn't repo in the egui repository? Maybe we just need to update the profiling or puffin crates?

@torokati44
Copy link
Contributor Author

torokati44 commented Sep 23, 2025

Maybe we just need to update the profiling or puffin crates?

format! returns a String: https://doc.rust-lang.org/std/macro.format.html
profiling::function_scope! takes a &str: https://docs.rs/profiling/latest/profiling/macro.function_scope.html

An example at the latter link conincidentally even has a format! in it, and it does have to have .as_str() after it...
What else could I say?

@torokati44
Copy link
Contributor Author

torokati44 commented Sep 23, 2025

@torokati44
Copy link
Contributor Author

But the problem doesn't repo in the egui repository?

Something would have to enable the profiling/profile-with-tracy feature, but nothing does, plus, it seems like it is mutually exclusive with profiling/profile-with-puffin (and probably all the others too), so...

@emilk
Copy link
Owner

emilk commented Sep 23, 2025

I see - thanks for explaining it

@emilk emilk added egui-winit porblems related to winit CI Continues Integration test labels Sep 23, 2025
@emilk emilk merged commit b69bab7 into emilk:main Sep 23, 2025
27 of 28 checks passed
podusowski pushed a commit to podusowski/egui that referenced this pull request Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continues Integration test egui-winit porblems related to winit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mismatched types error in egui-winit with profiling

2 participants