-
Notifications
You must be signed in to change notification settings - Fork 300
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
Fix log_initial for panic! and refine a panic! info #1124
Conversation
@fzyzcjy , done. |
Good job! I am quite busy now so will probably review today :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, only two nits!
@fzyzcjy , by the way, when running
Is this an issue? |
Looks like |
I guess so. And take a look at here:
Even changing the field And I wonder whether no other contributors ever mentioned this? Does it only occur on win10,which I work on? |
Meanwhile, the git action issue here is weird. Running |
Hmm can it be caused by version bumps? cc @Desdaemon - are you using windows and did you see the problem? Mine on macos: (base) ➜ flutter_rust_bridge git:(master) just dart_linter_pana
flutter pub global activate pana
Package pana is currently active at version 0.21.27.
Resolving dependencies...
The package pana is already activated at newest available version.
To recompile executables, first run `flutter pub global deactivate pana`.
Installed executable pana.
Activated pana 0.21.27.
cd frb_dart && pana --no-warning --line-length 80 --exit-code-threshold 0
INFO Running `/Users/tom/fvm/versions/3.7.7/bin/cache/dart-sdk/bin/dart --no-analytics --version`...
INFO Running `flutter --suppress-analytics --no-version-check --version --machine`...
INFO Running `git rev-parse --show-toplevel`...
INFO Running `/Users/tom/fvm/versions/3.7.7/bin/cache/dart-sdk/bin/dart --no-analytics pub get --no-example`...
INFO Running `/Users/tom/fvm/versions/3.7.7/bin/cache/dart-sdk/bin/dart --no-analytics pub outdated --json --up-to-date --no-dev-dependencies --no-dependency-overrides`...
INFO Analyzing package...
INFO Running `/Users/tom/fvm/versions/3.7.7/bin/cache/dart-sdk/bin/dart --no-analytics analyze --format machine bin`...
INFO Running `/Users/tom/fvm/versions/3.7.7/bin/cache/dart-sdk/bin/dart --no-analytics analyze --format machine lib`...
INFO Running `git init`...
INFO Running `git remote add origin https://github.com/fzyzcjy/flutter_rust_bridge`...
INFO Running `git remote show origin`...
INFO Running `git fetch --depth 1 --no-recurse-submodules origin master`...
INFO Running `git ls-tree -r --name-only --full-tree origin/master`...
INFO Running `git show origin/master:frb_dart/pubspec.yaml`...
INFO Running `git show origin/master:frb_example/pure_dart/dart/pubspec.yaml`...
INFO Running `git show origin/master:frb_example/pure_dart_multi/dart/pubspec.yaml`...
INFO Running `git show origin/master:frb_example/with_flutter/pubspec.yaml`...
INFO Running `/Users/tom/fvm/versions/3.7.7/bin/cache/dart-sdk/bin/dart --no-analytics format --output=none --set-exit-if-changed --line-length 80 /private/var/folders/j5/j6ymn7yd70564hzt31pq_0g80000gn/T/pana_li6Pqv/frb_dart/bin`...
INFO Running `/Users/tom/fvm/versions/3.7.7/bin/cache/dart-sdk/bin/dart --no-analytics format --output=none --set-exit-if-changed --line-length 80 /private/var/folders/j5/j6ymn7yd70564hzt31pq_0g80000gn/T/pana_li6Pqv/frb_dart/lib`...
## ✓ Follow Dart file conventions (30 / 30)
### [*] 10/10 points: Provide a valid `pubspec.yaml`
### [*] 5/5 points: Provide a valid `README.md`
### [*] 5/5 points: Provide a valid `CHANGELOG.md`
### [*] 10/10 points: Use an OSI-approved license
Detected license: `MIT`.
## ✓ Provide documentation (10 / 10)
### [*] 10/10 points: Package has an example
## ✓ Platform support (20 / 20)
### [*] 20/20 points: Supports 6 of 6 possible platforms (**iOS**, **Android**, **Web**, **Windows**, **MacOS**, **Linux**)
* ✓ Android
* ✓ iOS
* ✓ Windows
* ✓ Linux
* ✓ MacOS
* ✓ Web
## ✓ Pass static analysis (30 / 30)
### [*] 30/30 points: code has no errors, warnings, lints, or formatting issues
## ✓ Support up-to-date dependencies (20 / 20)
### [*] 10/10 points: All of the package dependencies are supported in the latest version
|Package|Constraint|Compatible|Latest|
|:-|:-|:-|:-|
|[`args`]|`^2.3.1`|2.4.0|2.4.0|
|[`build_cli_annotations`]|`^2.1.0`|2.1.0|2.1.0|
|[`colorize`]|`^3.0.0`|3.0.0|3.0.0|
|[`js`]|`^0.6.4`|0.6.7|0.6.7|
|[`meta`]|`^1.3.0`|1.9.0|1.9.0|
|[`path`]|`^1.8.1`|1.8.3|1.8.3|
|[`puppeteer`]|`^2.12.0`|2.23.0|2.23.0|
|[`shelf`]|`^1.3.2`|1.4.0|1.4.0|
|[`shelf_static`]|`^1.1.1`|1.1.1|1.1.1|
|[`shelf_web_socket`]|`^1.0.2`|1.0.3|1.0.3|
|[`tuple`]|`^2.0.1`|2.0.1|2.0.1|
|[`uuid`]|`^3.0.6`|3.0.7|3.0.7|
|[`web_socket_channel`]|`^2.2.0`|2.3.0|2.3.0|
|[`yaml`]|`^3.1.1`|3.1.1|3.1.1|
<details><summary>Transitive dependencies</summary>
|Package|Constraint|Compatible|Latest|
|:-|:-|:-|:-|
|[`archive`]|-|3.3.6|3.3.6|
|[`async`]|-|2.11.0|2.11.0|
|[`collection`]|-|1.17.1|1.17.1|
|[`convert`]|-|3.1.1|3.1.1|
|[`crypto`]|-|3.0.2|3.0.2|
|[`http`]|-|0.13.5|0.13.5|
|[`http_parser`]|-|4.0.2|4.0.2|
|[`logging`]|-|1.1.1|1.1.1|
|[`mime`]|-|1.0.4|1.0.4|
|[`petitparser`]|-|5.3.0|5.3.0|
|[`pointycastle`]|-|3.6.2|3.6.2|
|[`pool`]|-|1.5.1|1.5.1|
|[`source_span`]|-|1.9.1|1.9.1|
|[`stack_trace`]|-|1.11.0|1.11.0|
|[`stream_channel`]|-|2.1.1|2.1.1|
|[`string_scanner`]|-|1.2.0|1.2.0|
|[`term_glyph`]|-|1.2.1|1.2.1|
|[`typed_data`]|-|1.3.1|1.3.1|
</details>
To reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides`.
[`args`]: https://pub.dev/packages/args
[`build_cli_annotations`]: https://pub.dev/packages/build_cli_annotations
[`colorize`]: https://pub.dev/packages/colorize
[`js`]: https://pub.dev/packages/js
[`meta`]: https://pub.dev/packages/meta
[`path`]: https://pub.dev/packages/path
[`puppeteer`]: https://pub.dev/packages/puppeteer
[`shelf`]: https://pub.dev/packages/shelf
[`shelf_static`]: https://pub.dev/packages/shelf_static
[`shelf_web_socket`]: https://pub.dev/packages/shelf_web_socket
[`tuple`]: https://pub.dev/packages/tuple
[`uuid`]: https://pub.dev/packages/uuid
[`web_socket_channel`]: https://pub.dev/packages/web_socket_channel
[`yaml`]: https://pub.dev/packages/yaml
[`archive`]: https://pub.dev/packages/archive
[`async`]: https://pub.dev/packages/async
[`collection`]: https://pub.dev/packages/collection
[`convert`]: https://pub.dev/packages/convert
[`crypto`]: https://pub.dev/packages/crypto
[`http`]: https://pub.dev/packages/http
[`http_parser`]: https://pub.dev/packages/http_parser
[`logging`]: https://pub.dev/packages/logging
[`mime`]: https://pub.dev/packages/mime
[`petitparser`]: https://pub.dev/packages/petitparser
[`pointycastle`]: https://pub.dev/packages/pointycastle
[`pool`]: https://pub.dev/packages/pool
[`source_span`]: https://pub.dev/packages/source_span
[`stack_trace`]: https://pub.dev/packages/stack_trace
[`stream_channel`]: https://pub.dev/packages/stream_channel
[`string_scanner`]: https://pub.dev/packages/string_scanner
[`term_glyph`]: https://pub.dev/packages/term_glyph
[`typed_data`]: https://pub.dev/packages/typed_data
### [*] 10/10 points: Package supports latest stable Dart and Flutter SDKs
## ✓ Support sound null safety (20 / 20)
### [*] 20/20 points: Package and dependencies are fully migrated to null safety!
Points: 130/130.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to merge after the hook thing :)
A bit more context about hooks: e.g. rust-lang/rust#92649 says "the common use case" as: let prev = panic::take_hook();
panic::set_hook(Box::new(move |info| {
println!("panic handler A");
prev(info);
})); so we can just do this. (note that I am not saying we should use the |
No, I haven't been using Windows recently but I can check if the problem persists. |
Well done :) |
I was able to determine that the issue @dbsxdbsx encountered is an upstream issue. A sample script: import 'package:path/path.dart' as p;
void main() {
final path = 'frb_dart/pubspec.yaml';
print({
'path': path,
'normalized': p.normalize(path),
});
} yields
and yet Pana expects normalization to be a no-op here: Don't know what's the expected behavior here, might open an issue upstream later. |
@Desdaemon Then, shall we somehow input the path as |
Opened an issue at dart-lang/pana#1207 |
Changes
Before, the rust
panic!
would not be logged to disk. So this pr fixed this and refine the output panic info more friendly for #1123.