Delete and update stale documentation regarding engine/engine hash. (#164324)
This is intended to be merged _after_ https://github.com/flutter/flutter/pull/164317.
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
## Symbolicating stack traces for engine crashes
|
||||
# Symbolicating stack traces for engine crashes
|
||||
|
||||
iOS app archives produced using Flutter 3.24 or later embed engine debugging symbols and thus crashes are symbolicated by default.
|
||||
|
||||
The easiest way to symbolicate stack traces for Android and older iOS apps is to run the [dart_ci symbolizer locally](https://github.com/dart-lang/dart_ci/blob/main/github-label-notifier/symbolizer/README.md#using-this-locally). If that is not an option, the steps below explain how to do it manually.
|
||||
|
||||
### Android
|
||||
## Android
|
||||
|
||||
#### Get the symbols
|
||||
### Get the symbols
|
||||
|
||||
1. Get the Flutter Framework or Flutter Engine revision from the report. If you have the Engine revision, skip to step 3.
|
||||
|
||||
2. Get the Engine revision from the Framework (this could be automated). https://github.com/flutter/flutter/blob/main/bin/internal/engine.version is the file which contains the information. Substitute the framework hash for `main` in that url.
|
||||
2. Get the Engine revision from the Framework (this could be automated). `flutter/blob/main/bin/cache/engine.stamp` is the file which contains the information. Substitute the framework hash for `main` in that url.
|
||||
|
||||
3. With the full engine revision (e.g. cea5ed2b9be42a981eac762af3664e4a17d0a53f), you can now get the proper symbol files:
|
||||
|
||||
@@ -20,12 +20,12 @@ The easiest way to symbolicate stack traces for Android and older iOS apps is to
|
||||
|
||||
Please be aware that the type of the symbol must match your Apps release type. In above example, this refers to a android-arm **debug** build. If you work with a **release** or **profile** build, the URLs would look like this:
|
||||
|
||||
* https://storage.cloud.google.com/flutter_infra_release/flutter/cea5ed2b9be42a981eac762af3664e4a17d0a53f/android-arm-release/symbols.zip
|
||||
* https://storage.cloud.google.com/flutter_infra_release/flutter/cea5ed2b9be42a981eac762af3664e4a17d0a53f/android-arm-profile/symbols.zip
|
||||
* <https://storage.cloud.google.com/flutter_infra_release/flutter/cea5ed2b9be42a981eac762af3664e4a17d0a53f/android-arm-release/symbols.zip>
|
||||
* <https://storage.cloud.google.com/flutter_infra_release/flutter/cea5ed2b9be42a981eac762af3664e4a17d0a53f/android-arm-profile/symbols.zip>
|
||||
|
||||
You have to use your browser because it does authentication.
|
||||
|
||||
#### Symbolicate with ndk-stack
|
||||
### Symbolicate with ndk-stack
|
||||
|
||||
Once you have the symbols unzipped, you can use ndk-stack from your Android NDK. Suppose `stack.txt` contains the stack (including the leading `*** *** ***` line from the crash):
|
||||
|
||||
@@ -40,7 +40,7 @@ Or on macOS:
|
||||
|
||||
Some debugging tools, like _pidcat_ may not show the full tombstone logs. In that case, please use `adb logcat` directly and copy the full output.
|
||||
|
||||
#### Symbolicate with addr2line
|
||||
### Symbolicate with addr2line
|
||||
|
||||
A alternative way to symbolicate is by using the addr2line tool. It is bundled with the NDK.
|
||||
To use it, simply call it with a path to the .so file downloaded above and feed the stack addresses to it manually. For example, on macOS:
|
||||
@@ -55,7 +55,7 @@ _The tool is now awaiting your input, so let's feed it a memory address_:
|
||||
```
|
||||
This revealed address `0x00000000006a26ec` to correspond with `dart_api_impl.cc:1366`.
|
||||
|
||||
#### Making sure you got the right libflutter.so
|
||||
### Making sure you got the right libflutter.so
|
||||
|
||||
The build system sets a build id for each `libflutter.so` file. In the tombstones, you would see the ID like so:
|
||||
|
||||
@@ -65,24 +65,23 @@ The build system sets a build id for each `libflutter.so` file. In the tombstone
|
||||
|
||||
This equals to a build id of **34ad5bdf0830d77a**. The `libflutter.so` debug files downloaded as shown above could be verified using the `file` command:
|
||||
|
||||
```
|
||||
```sh
|
||||
% file ~/Downloads/libflutter.so
|
||||
/Users/user/Downloads/libflutter.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[xxHash]=34ad5bdf0830d77a, with debug_info, not stripped
|
||||
```
|
||||
|
||||
Ensure the build IDs match, else you will not be able to symbolicate.
|
||||
|
||||
#### Expanding Git Revisions
|
||||
### Expanding Git Revisions
|
||||
|
||||
Go to a commit page with the short commit as the last fragment of the URL:
|
||||
(e.g. https://github.com/flutter/flutter/commit/9cb914df1 or https://github.com/flutter/engine/commit/2a13567) and then find the full revision on the page.
|
||||
|
||||
|
||||
#### Symbolicating local builds
|
||||
### Symbolicating local builds (Android)
|
||||
|
||||
If you have made your own builds, you can use ndk-stack directly:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
# dev/engine is where your engine's .gclient file is
|
||||
# android_debug_unopt is whatever build of your engine you are using
|
||||
adb logcat | ~/dev/engine/src/third_party/android_tools/ndk/prebuilt/linux-x86_64/bin/ndk-stack -sym ~/dev/engine/src/out/android_debug_unopt
|
||||
@@ -94,8 +93,8 @@ Since Flutter 3.24, symbols can be found in the Flutter framework's artifact
|
||||
cache, within the xcframework bundle at
|
||||
`bin/cache/artifacts/engine/ios-release/Flutter.xcframework`.
|
||||
|
||||
* Symbols for device builds are in the `ios-arm64/dSYMs/Flutter.framework.dSYM` bundle.
|
||||
* Symbols for simulator builds are in the `ios-arm64_x86_64-simulator/dSYMs/Flutter.framework.dSYM` bundle.
|
||||
* Symbols for device builds are in the `ios-arm64/dSYMs/Flutter.framework.dSYM` bundle.
|
||||
* Symbols for simulator builds are in the `ios-arm64_x86_64-simulator/dSYMs/Flutter.framework.dSYM` bundle.
|
||||
|
||||
For versions prior to Flutter 3.24, the dSYM bundle can downloaded from Google
|
||||
Cloud Storage. Follow the steps from the Android section in this guide, but in
|
||||
@@ -116,7 +115,7 @@ Since Flutter 3.27, symbols can be found in the Flutter framework's artifact
|
||||
cache, within the xcframework bundle at
|
||||
`bin/cache/artifacts/engine/darwin-x64-release/Flutter.xcframework`.
|
||||
|
||||
* Symbols for device builds are in the `macos-arm64_x86_64/dSYMs/FlutterMacOS.framework.dSYM` bundle.
|
||||
* Symbols for device builds are in the `macos-arm64_x86_64/dSYMs/FlutterMacOS.framework.dSYM` bundle.
|
||||
|
||||
For versions prior to Flutter 3.27, the dSYM bundle can downloaded from Google
|
||||
Cloud Storage. Follow the steps from the Android section in this guide, but in
|
||||
@@ -131,11 +130,11 @@ schema:
|
||||
`https://storage.googleapis.com/flutter_infra_release/flutter/cf4507ae1008c11c6155d31e852999d75670afcf/darwin-x64-release/framework.zip`
|
||||
(replace the engine hash with your hash).
|
||||
|
||||
#### Symbolicating local builds
|
||||
### Symbolicating local builds (macOS)
|
||||
|
||||
If you built your local engine in debug or profile Dart modes, the framework's dylib's symbols aren't stripped and are available by default.
|
||||
|
||||
#### Crashes in Dart AOT code
|
||||
### Crashes in Dart AOT code
|
||||
|
||||
If the crash is in AOT Dart code (in `--release` or `--profile` builds) on iOS, and you can build your own engine, these steps will be helpful for the VM team to fix the bug:
|
||||
|
||||
@@ -158,8 +157,7 @@ If the crash is in AOT Dart code (in `--release` or `--profile` builds) on iOS,
|
||||
* Look for the function name (by substring match) in this file and copy out that information to the bug.
|
||||
* Ping someone on dart-lang/sdk.
|
||||
|
||||
|
||||
### Android Local Engine Builds
|
||||
## Android Local Engine Builds
|
||||
|
||||
When running with a local engine build, the symbolization workflow can be cumbersome and unecessary. Instead, it is possible to build the engine itself with symbols and disable Gradle's automatic symbol stripping. This is also required to see symbol names in Android Studio CPU profiles.
|
||||
|
||||
@@ -167,9 +165,8 @@ When running with a local engine build, the symbolization workflow can be cumber
|
||||
|
||||
2. In the flutter project file `android/app/build.gradle`, add the following line under the `android` block:
|
||||
|
||||
```
|
||||
packagingOptions{
|
||||
doNotStrip "**/*.so"
|
||||
}
|
||||
|
||||
```gradle
|
||||
packagingOptions{
|
||||
doNotStrip "**/*.so"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -24,7 +24,6 @@ This is an index of team-facing documentation for the [flutter/engine repository
|
||||
- [Supporting legacy platforms](Supporting-legacy-platforms.md)
|
||||
- [Testing Android Changes in the Devicelab on an Emulator](https://github.com/flutter/flutter/blob/master/docs/platforms/android/Testing-Android-Changes-in-the-Devicelab-on-an-Emulator.md)
|
||||
- [Testing the engine](./testing/Testing-the-engine.md)
|
||||
- [Testing presubmit Engine PRs with the Flutter framework](Testing-presubmit-Engine-PRs-with-the-Flutter-framework.md)
|
||||
- [The Engine architecture](https://github.com/flutter/flutter/blob/master/docs/about/The-Engine-architecture.md)
|
||||
- [Upgrading Engine's Android API version](https://github.com/flutter/flutter/blob/master/docs/platforms/android/Upgrading-Engine's-Android-API-version.md)
|
||||
- [Using the Dart Development Service (DDS) and Flutter DevTools with a custom Flutter Engine Embedding](./Using-the-Dart-Development-Service-(DDS)-and-Flutter-DevTools-with-a-custom-Flutter-Engine-Embedding.md)
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
# Running Framework presubmit tests on Engine PRs
|
||||
|
||||
This documentation describes how to run flutter/flutter presubmit checks on flutter/engine PRs before submitting them.
|
||||
|
||||
## Overview
|
||||
|
||||
1. Create your engine pull request with the `test: all` label.
|
||||
2. Wait for all presubmit checks on your flutter/engine PR to be green.
|
||||
3. Determine the commit hash for your flutter/engine PR.
|
||||
4. Create and upload a flutter/flutter PR, (OR run tests locally).
|
||||
5. Wait for flutter/flutter presubmits/tests to run ☕.
|
||||
|
||||
## 1. Create your engine pull request with the `test: all` label.
|
||||
|
||||
When creating your PR, add the `test: all` label *before* submitting the PR to
|
||||
CI. This will ensure that all builds required for framework testing are
|
||||
triggered.
|
||||
|
||||
If you sent out your PR without adding the `test: all` label, you can add it,
|
||||
then re-push your branch to re-trigger presubmits.
|
||||
|
||||
By default, [not all builds and tests are run][engine_presubmits] in engine
|
||||
presubmits. When our CI is able to determine that certain shards are unaffected
|
||||
by a change, via a `runIf` clause in our `.ci.yaml`, for example, it will be
|
||||
skipped. Many framework tests, however, assume all build products are present
|
||||
and will trigger a `flutter precache`, which will fail with a 404 on missing
|
||||
build artifacts.
|
||||
|
||||
[engine_presubmits]: ci/Engine-pre-submits-and-post-submits.md#running-post-submits-eagerly
|
||||
|
||||
## 2. Wait
|
||||
|
||||
Contemplate the nature of the universe or why it is that this workflow was necessary for your situation. Could tests have been added to the engine? If not, get youself some coffee and a cookie. You'll need them.
|
||||
|
||||
## 3. The commit hash
|
||||
|
||||
1. Go to the "Commits" tab in the GitHub UI for you Engine PR.
|
||||
1. Click the button to copy the most recent commit hash to your clipboard.
|
||||
|
||||
<img width="1128" alt="Screenshot 2023-08-04 at 12 54 55 PM" src="https://github.com/flutter/flutter/assets/6343103/491be0dd-e29b-4057-a077-3a28d3beec9e">
|
||||
|
||||
## 4. Create and upload a flutter/flutter PR.
|
||||
|
||||
Edit your flutter/flutter checkout as follows:
|
||||
|
||||
1. `bin/internal/engine.version` should be edited to contain the commit hash from (2).
|
||||
1. `bin/internal/engine.realm` should be edited to contain the string `flutter_archives_v2`.
|
||||
|
||||
To run flutter/flutter presubmits on CI, you can accomplish these two edits directly in the GitHub editor UI, if desired. Otherwise, upload a flutter/flutter PR with these changes.
|
||||
|
||||
You can also build apps, and run tests locally at this point.
|
||||
|
||||
## 5. Wait for flutter/flutter presubmits to run ☕.
|
||||
|
||||
The flutter/flutter presubmit checks will run. There will be at least two failures:
|
||||
1. A Flutter CLI test will ensure that a PR with a non-empty `engine.realm` file will fail a presubmit check.
|
||||
1. The `fuchsia_precache` test will fail because Fuchsia artifacts are not uploaded from Engine presubmit runs.
|
||||
|
||||
Any other failures are possibly due to the changes to flutter/engine, so deflake and examine them carefully.
|
||||
|
||||
## 6. Devicelab tests
|
||||
|
||||
A subset of devicelab tests are available for optionally running in presubmit on flutter/flutter PRs. They are the tests listed in the flutter/flutter [.ci.yaml](https://github.com/flutter/flutter/blob/main/.ci.yaml) file that are prefixed with `Linux_android`, `Mac_android`, and `Mac_ios`.
|
||||
|
||||
To run one of these tests, remove the line `presubmit: false` from the `.ci.yaml` file under the test you'd like to run. For an example, see the PR [here](https://github.com/flutter/flutter/pull/135254).
|
||||
|
||||
<img width="1117" alt="Screenshot 2023-09-21 at 3 19 51 PM" src="https://github.com/flutter/flutter/assets/6343103/9d234e82-1d6e-430b-a08e-d70bb9267462">
|
||||
|
||||
This will trigger the devicelab test to run. The test will show up in the list of presubmit checks, and you can click through to the [LUCI page](https://ci.chromium.org/ui/p/flutter/builders/try/Linux_android%20new_gallery__transition_perf/2/overview) to see the results.
|
||||
Reference in New Issue
Block a user