Skip to content

[flutter_tools] Consolidate ToolDependencies.bootstrap builders and require extension managers - #196388

Merged
auto-submit[bot] merged 13 commits into
flutter:masterfrom
bkonyi:di/runner-3-tool-dependencies-bootstrap
Nov 23, 2026
Merged

auto-submit[bot] merged 13 commits into
flutter:masterfrom
bkonyi:di/runner-3-tool-dependencies-bootstrap

Conversation

@bkonyi

@bkonyi bkonyi commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Consolidates the 13 (foo, fooBuilder) override-bridging parameter pairs on ToolDependencies.bootstrap, replaces preRunValidatorBuilder with enablePreRunValidator, removes unused androidWorkflow, emulatorManager, macOSWorkflow, and windowsWorkflow bootstrap overrides, makes extensionManager, extensionBuildManager, and extensionCleanManager required non-nullable fields on ToolDependencies, and makes AndroidContext builder fields private.

Part of #47161

…eateGlobalArgParser

Makes `FlutterCommandRunner` dependency fields required and non-nullable, extracts `FlutterCommandRunner.createGlobalArgParser` for early top-level flag parsing, and removes `_FallbackToolContext` from `lib/executable.dart`.

Part of flutter#47161
Migrates `lib/runner.dart` off `runInContext` and `overrides` so it accepts
an explicit `ToolDependencies` instance alongside explicit
`FlutterHookRunner` and `WebRunnerFactory` arguments. Removes
`AppContext.hasOverride` and `AppContext.resolveOverride`, which are no
longer needed.

Part of flutter#47161
…equire extension managers

Removes the `*Builder` parameters on `ToolDependencies.bootstrap` that duplicated their direct-value counterparts, replaces `preRunValidatorBuilder` with an `enablePreRunValidator` flag (asserting it is not combined with an explicit `preRunValidator`), and drops the unused `androidWorkflow`, `emulatorManager`, `httpClientFactory`, `macOSWorkflow`, and `windowsWorkflow` parameters.

Makes `extensionManager`, `extensionBuildManager`, and `extensionCleanManager` required non-nullable fields on `ToolDependencies`, removing the `!` unwraps in `executable.dart` and `runner.dart`, and makes the `AndroidContext` builder fields private.

Updates `FakeToolDependencies` and the bootstrap laziness tests. The `dependency_injection_test.dart` laziness test now plants a discoverable Android Studio install so a strict `FakeProcessManager` fails if `bootstrap` eagerly evaluates `AndroidStudio` or `Java`.

Part of flutter#47161
@bkonyi bkonyi added tool Affects the "flutter" command-line tool. See also t: labels. CICD Run CI/CD labels Nov 11, 2026
…findCommandName

Make _createGlobalArgParser private on FlutterCommandRunner and move findCommandName onto FlutterCommandRunner for pre-bootstrap command inspection.
…e-run-in-context

# Conflicts:
#	packages/flutter_tools/lib/executable.dart
#	packages/flutter_tools/lib/runner.dart
#	packages/flutter_tools/test/general.shard/runner/runner_test.dart
…l-dependencies-bootstrap

# Conflicts:
#	packages/flutter_tools/lib/src/context/android_context.dart
@github-actions github-actions Bot added the team-android Owned by Android platform team label Nov 13, 2026
# Conflicts:
#	packages/flutter_tools/lib/runner.dart
… into di/runner-3-tool-dependencies-bootstrap

# Conflicts:
#	packages/flutter_tools/lib/executable.dart
#	packages/flutter_tools/lib/src/context/tool_dependencies.dart
#	packages/flutter_tools/test/general.shard/args_test.dart
#	packages/flutter_tools/test/general.shard/context/dependency_injection_test.dart
#	packages/flutter_tools/test/general.shard/runner/runner_test.dart
#	packages/flutter_tools/test/src/fakes.dart
@bkonyi
bkonyi marked this pull request as ready for review November 18, 2026 21:08
@bkonyi
bkonyi requested a review from a team as a code owner November 18, 2026 21:08
@bkonyi
bkonyi requested review from gmackall and removed request for a team November 18, 2026 21:08

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors ToolDependencies and AndroidContext to simplify dependency injection, making several manager fields non-nullable and replacing various builder parameters in ToolDependencies.bootstrap with direct instance parameters or a boolean flag (enablePreRunValidator). However, in AndroidContext, renaming the constructor parameters to private fields (e.g., this._androidSdkBuilder) makes the named parameters private, which will cause compile-time errors when instantiating AndroidContext from other libraries like ToolDependencies.

@bkonyi
bkonyi requested review from chingjun and removed request for gmackall November 18, 2026 21:31
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 23, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into flutter:master with commit cd9ce34 Nov 23, 2026
21 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 23, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Nov 24, 2026
flutter/flutter@98744d3...b75c5b3

2026-11-24 [email protected] Roll Skia from 89e364b13f05 to 2140958ee284 (3 revisions) (flutter/flutter#197287)
2026-11-24 [email protected] Roll Skia from f82f3efc0461 to 89e364b13f05 (6 revisions) (flutter/flutter#197284)
2026-11-24 [email protected] Roll Dart SDK from 10aef26c73f5 to 87f515c52de9 (1 revision) (flutter/flutter#197279)
2026-11-24 [email protected] iOS: Drive platform view tests through IOSExternalViewEmbedder (flutter/flutter#197263)
2026-11-24 [email protected] Fix null check crash in flushSemantics from a stale ancestor geometry cache (flutter/flutter#192724)
2026-11-24 [email protected] [Impeller] Fix Windows build with MSVC 14.52: std::modf is [[nodiscard]] (flutter/flutter#193413)
2026-11-24 [email protected] [web] Preserve fill rules from path operations (flutter/flutter#195971)
2026-11-24 [email protected] Regenerate tool_test_durations.json (flutter/flutter#197261)
2026-11-24 [email protected] Roll Skia from 694af434cadd to f82f3efc0461 (4 revisions) (flutter/flutter#197258)
2026-11-24 [email protected] Increase number of 'Linux tool_integration_tests' subshards (flutter/flutter#197262)
2026-11-24 [email protected] Run tool_integration_tests app tests in one subshard instead of all of them (flutter/flutter#197264)
2026-11-24 [email protected] [flutter_tools] Pass featureFlags in localizations_test.dart (flutter/flutter#197269)
2026-11-23 [email protected] Fix Orca flat review in Linux accessibility (flutter/flutter#196338)
2026-11-23 [email protected] [flutter tools] Pass --client-id=flutter-analyze to the analysis server (flutter/flutter#197227)
2026-11-23 [email protected] [Flutter GPU] Expose the maximum render target size (flutter/flutter#196640)
2026-11-23 [email protected] iOS: Don't clear raster thread state in platform views reset (flutter/flutter#197025)
2026-11-23 [email protected] iOS: Composite platform views from layers in tests (flutter/flutter#197021)
2026-11-23 [email protected] [flutter_tools] Harden extension diagnostics models and RPC failure handling (flutter/flutter#196233)
2026-11-23 [email protected] [flutter_tools] Support standalone UI packages in gen-l10n (flutter/flutter#194500)
2026-11-23 [email protected] [flutter_tools] Consolidate ToolDependencies.bootstrap builders and require extension managers (flutter/flutter#196388)
2026-11-23 [email protected] Roll Skia from 31b19bdc8195 to 694af434cadd (2 revisions) (flutter/flutter#197239)
2026-11-23 [email protected] Roll Dart SDK from df632229552e to 10aef26c73f5 (1 revision) (flutter/flutter#197234)
2026-11-23 [email protected] [macOS] Fix back buffer cache returning a wrong-size surface (Impeller null deref in Canvas::SetupRenderPass) (flutter/flutter#192522)
2026-11-23 [email protected] Add Settings::frame_built_callback for UI frame build timings (flutter/flutter#197213)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants