Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve backtraces when hovering widgets with modifiers pressed #4696

Merged
merged 5 commits into from
Jun 23, 2024

Conversation

emilk
Copy link
Owner

@emilk emilk commented Jun 23, 2024

A useful debug-feature in egui is pressing down all modifiers keys and hovering any widget to see its backtrace (only in dev builds). Unfortunately this is incompatible with panic="abort", something I just now discovered.

So I removed panic="abort" from Cargo.toml for dev builds. If the backtrace returns empty-handed, I also suggests this as a fix to the user. Finally, I cleaned up the backtraces a bit, making them slightly shorter and more readable.

@emilk emilk added feature New feature or request egui labels Jun 23, 2024
emilk added a commit to rerun-io/rerun that referenced this pull request Jun 23, 2024
The `backtrace` crate isn't compatible with `panic="abort"` (see
[docs](https://docs.rs/backtrace/latest/backtrace/) and
[issue](rust-lang/backtrace-rs#397)).

One great feature we have in egui is pressing down all modifier keys
on your keyboard and seeing the backtrace to the widget you hover.
This is awesome for when you want to change the code for some
specific part of the UI. But it didn't work, at least not always.

This PR fixes it.

We still use `panic="abort"` in release builds, for the benefit
of smaller binaries.

* See also emilk/egui#4696
@emilk emilk merged commit db8db50 into master Jun 23, 2024
37 checks passed
@emilk emilk deleted the emilk/better-backtraces branch June 23, 2024 15:03
emilk added a commit to rerun-io/rerun that referenced this pull request Jun 24, 2024
The `backtrace` crate isn't compatible with `panic="abort"` (see
[docs](https://docs.rs/backtrace/latest/backtrace/) and
[issue](rust-lang/backtrace-rs#397)).

One great feature we have in egui is pressing down all modifier keys on
your keyboard and seeing the backtrace to the widget you hover. This is
awesome for when you want to change the code for some specific part of
the UI. But it didn't work, at least not always.

This PR fixes it.

We still use `panic="abort"` in release builds, for the benefit of
smaller binaries.

* See also emilk/egui#4696


https://github.com/rerun-io/rerun/assets/1148717/cff9ddbe-838c-4e67-937a-e7dd97d1537f


### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6608?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6608?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6608)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
…k#4696)

A useful debug-feature in egui is pressing down all modifiers keys and
hovering any widget to see its backtrace (only in `dev` builds).
Unfortunately this is incompatible with `panic="abort"`, something I
just now discovered.

So I removed `panic="abort"` from `Cargo.toml` for `dev` builds. If the
backtrace returns empty-handed, I also suggests this as a fix to the
user. Finally, I cleaned up the backtraces a bit, making them slightly
shorter and more readable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant