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

[CP-stable][iOS] Bundle dSYM packages in Flutter.xcframework #54513

Conversation

flutteractionsbot
Copy link

@flutteractionsbot flutteractionsbot commented Aug 12, 2024

This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

Issue Link:

What is the link to the issue this cherry-pick is addressing?

flutter/flutter#116493

Note this includes two PRs:
#54414
#54458

Changelog Description:

Bundle iOS framework debugging symbols (Flutter.framework.dSYM) in Flutter.xcframework in iOS release builds. This eliminates the need for manual download/bundling of Flutter debug symbols for release build crash log symbolication. As of Xcode 16, these symbols are required to be bundled with App Store archives.

Impact Description:

Without these bundled symbols, iOS App Store validation fails for Flutter apps under Xcode 16.

Workaround:

Is there a workaround for this issue?

Users can follow the steps described in docs/Crashes.md to manually locate the engine SHA used in their Flutter app, download the Flutter.dSYM archive, and manually copy it into their app archive prior to App Store validation. This is very manual process with room for a lot of error. This process is not at all obvious or well-documented.

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

In the case where dSYM extraction fails, we'll know immediately since the build will fail. dSYMs can be verified using the steps below.

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes (verified through the build rather than the tests)
  • No

In this case the build itself will fail if dSYM extraction fails. Testing of bundling is covered in framework tool tests.

Validation Steps:

What are the steps to validate that this fix works?

artifacts.zip can be checked at any commit on or after c11fe483947c95553610ab59210af643f031f5f4. For example https://storage.googleapis.com/flutter_infra_release/flutter/c11fe483947c95553610ab59210af643f031f5f4/ios-release/artifacts.zip

Verify that Flutter.xcframework in this archive contains ios-arm64/dSYMs/Flutter.framework.dSYM.

As of Xcode 16, App Store validation requires dSYMs for frameworks in app archives. Bundling dSYMs also significantly simplifies stack trace symbolification, so we should be doing this regardless.

This adds both framework and simulator framework dSYMs to the Flutter.xcframework bundle.

Issue: flutter/flutter#116493

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
@flutteractionsbot flutteractionsbot added the cp: review add the cp request to the review queue of release engineers label Aug 12, 2024
@flutteractionsbot
Copy link
Author

@jmagman please fill out the PR description above, afterwards the release team will review this request.

Renames our Flutter framework dSYM to `Flutter.framework.dSYM` for consistency with all other dSYM bundle names. In iOS release archives, all other dSYM files are:

* `App.framework`: `App.framework.dSYM`
* `Runner.app`: `Runner.app.dSYM`

We continue to archive the dSYM to `Flutter.dSYM.zip` for backward compatibility with the existing instructions for manual symbolification in `docs/Crashes.md` and to remain compatible with dart-lang/dart-ci's symbolizer which expects `Flutter.dSYM` in [`Symbolizer._symbolizeIosFrames`][symbolizer].

Followup to: flutter#54414
Issue: flutter/flutter#116493
Motto: [Embrace the yak shave][yak_shave].

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
@cbracken
Copy link
Member

I've filled out the details.

@jmagman jmagman requested a review from zanderso August 12, 2024 19:56
@itsjustkevin itsjustkevin added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 13, 2024
@auto-submit auto-submit bot merged commit 9262f08 into flutter:flutter-3.24-candidate.0 Aug 13, 2024
26 checks passed
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 13, 2024
### Issue Link:
What is the link to the issue this cherry-pick is addressing?

#116493

Dependent on engine-side CP flutter/engine#54513

### Changelog Description:
Flutter now bundles iOS framework debugging symbols in app archives built with `flutter build ipa` or Xcode's *Product > Archive* command. This eliminates the need for manual download/bundling of Flutter debug symbols for release build crash log symbolication, and as of Xcode 16, these symbols are now required for app archives to pass App Store validation.

### Impact Description:
Without these bundled symbols, iOS App Store validation fails for Flutter apps under Xcode 16, making it impossible for developers to publish to the iOS App Store.

### Workaround:
Use Xcode 15.

### Risk:
What is the risk level of this cherry-pick?

The change itself is quite simple and in the case where we can't find a bundled Flutter.framework.dSYM inside the flutter tool's artifact cache, we simply fall back to the previous behaviour of not copying it. 

In the case where the Flutter.framework.dSYM is found in the artifact cache (which is the expected case), we simply perform a copy using `rsync` as we do with Flutter.framework itself. This is also relatively low-risk.

Further, this change has been verified by @cbracken using Flutter's own organisation on the App Store, and by [a non-Google developer](#116493 (comment)). 

However, I'm flagging as medium-risk since this change has only had two days of bake time for us to collect feedback, and while I expect there's a very low likelihood of an issue, we haven't yet got sufficient feedback to say definitively that we haven't missed any edge-cases.

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:
What are the steps to validate that this fix works?

The developer performing these steps will need to have *App Manager* permissions for their development team in App Store Connect.

1. Install Xcode 16 beta.
2. Make Xcode 16 beta the default on your machine: `xcode-select -s /Applications/Xcode-beta.app`
3. Create the default clickcounter app: `flutter create clickcounter`
4. Open `ios/Runner.xcworkspace` in Xcode beta 16.
5. In the project explorer sidebar, select the *Runner* app, then select the *Signing & Capabilities* tab.
6. Set the bundle identifier to the bundle identifier of your app as configured in App Store Connect.
7. From the team dropdown, select a team for which you have developer permissions.
8. From the menu bar, select *Product > Archive*. This will open the Organizer window. You can open it again later from the *Window* menu or via Command-Option-Shift-O.
9. Select the archive, then click *Validate App.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App cp: review add the cp request to the review queue of release engineers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants