Extend --shorebird-trace to aar, ios-framework, and desktop builds#136
Draft
eseidel wants to merge 1 commit intoshorebird/devfrom
Draft
Extend --shorebird-trace to aar, ios-framework, and desktop builds#136eseidel wants to merge 1 commit intoshorebird/devfrom
eseidel wants to merge 1 commit intoshorebird/devfrom
Conversation
Shorebird's release flow passes --shorebird-trace=<path> to every flutter build subcommand it invokes. Only apk, appbundle, ios, and ipa were registering the option, so aar / ios-framework / linux / macos / windows builds failed argparse hard as soon as Shorebird's version gate admitted tracing. - Register usesShorebirdTraceOption() on BuildAarCommand, BuildFrameworkCommand, and (via addCommonDesktopBuildOptions) every desktop build command. - Wire AAR through the existing AndroidBuildTraceSession so `flutter build aar --shorebird-trace` actually produces per-task gradle trace data, mirroring the APK path in buildGradleApp. For the desktop and framework subcommands the option is accepted but not yet wired into the native orchestrators — Shorebird's in-process tracer still fills in the trace file so callers get a usable (shorebird-side) trace instead of a crash.
eseidel
added a commit
to shorebirdtech/shorebird
that referenced
this pull request
Apr 21, 2026
…rt it (#3708)" This reverts commit 2d0f891. #3708 probed each `flutter build <cmd> -h` at runtime to decide whether to pass `--shorebird-trace`. That was a belt-and-suspenders guard around two real bugs: 1. The Shorebird gate mis-classified unresolved Flutter versions (dev revisions not on any `flutter_release/*` branch) as new enough, so it opted pre-feature pins into tracing. 2. `flutter build aar` / `ios-framework` / `linux` / `macos` / `windows` didn't register the option, so the flag couldn't be forwarded to them safely. The previous commit on this branch fixes (1). The companion shorebirdtech/flutter#136 fixes (2) and must be on the Shorebird Flutter pin before this lands. With both in place, every subcommand this CLI invokes accepts the flag when the gate admits tracing, and every subcommand refuses it when the gate rejects tracing — so the per-subcommand runtime probe (plus its 8 per-command call-site detours and its help-output cache) is dead weight.
4 tasks
Author
|
This and shorebirdtech/shorebird#3709 make an alternative to the dynamic discovery of --shorebird-trace that you did this afternoon. Let me know if you want them or if you just want to keep the dynamic discovery @bdero |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Shorebird's release flow passes
--shorebird-trace=<path>to everyflutter buildsubcommand it invokes. Onlyapk,appbundle,ios, andipawere registering the option, soaar/ios-framework/linux/macos/windowsbuilds failed argparse as soon as Shorebird's version gate admitted tracing.usesShorebirdTraceOption()onBuildAarCommand,BuildFrameworkCommand, and — viaaddCommonDesktopBuildOptions— every desktop build command.AndroidBuildTraceSessionsoflutter build aar --shorebird-traceactually produces per-task gradle trace data, mirroring the APK path inbuildGradleApp.For the desktop and framework subcommands the option is accepted but not yet wired into the native build orchestrators — that's a follow-up. Shorebird's in-process tracer still fills in the trace file, so callers get a usable (shorebird-side) trace instead of a crash.
Companion to shorebirdtech/shorebird#3709, which flips the Shorebird-side version gate to stop forwarding
--shorebird-traceto Flutter pins that don't know the flag.Test plan
dart pub run test test/general.shard/android/android_gradle_builder_test.dart test/general.shard/build_system/build_trace_test.dart test/commands.shard/hermetic/build_macos_test.dart test/commands.shard/hermetic/build_windows_test.dart— 87 tests pass, including the existing AAR gradle-builder cases.flutter build {aar,ios-framework,linux,macos,windows} -h --verbosenow lists--shorebird-tracein the option output.