Repository navigation
[flutter_tools] Migrate bin/fuchsia_tester.dart off globals and runInContext - #196074
Merged
auto-submit[bot] merged 223 commits intoNov 11, 2026
Merged
Conversation
…ice away from globals
… project Inject dependencies into FlutterApplicationMigration, buildMacOS, and XcodeBasedProject (IosProject and MacOSProject) to remove direct globals.dart usages.
…and inject FlutterVersion into MacOSDevice
…imulators, emulators, and LLDB
Updates buildXcodeProject in packages/flutter_tools/lib/src/ios/mac.dart to require ToolContext along with explicit Apple dependencies instead of accepting individual ToolContext fields with fallback instantiations. Also restores running SwiftPackageManagerIntegrationMigration unconditionally when building via IOSDevice and IOSSimulator.
…and-xcode-project
…ed in iOS device/emulator classes
…ix FlutterProject.fromDirectoryTest logger fallback
…, and ToolDependencies.bootstrap
…and-xcode-project
# Conflicts: # packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart
…and-simulators # Conflicts: # packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart
# Conflicts: # packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart
# Conflicts: # packages/flutter_tools/lib/src/context/tool_dependencies.dart
…ication packages Eliminates ambient `globals` usage in `ios/application_package.dart`, `macos/application_package.dart`, `windows/application_package.dart`, and `flutter_application_package.dart` by injecting `FileSystem`, `Logger`, `OperatingSystemUtils`, `Platform`, and `PlistParser` explicitly.
…devices Migrates buildLinux, buildWindows, DesktopDevice, and CustomDevice away from globals.dart to explicit dependency injection via ToolContext. Part of flutter#188471
Eliminates ambient `globals` usage from `packages/flutter_tools/lib/src/build_info.dart` by requiring explicit `Config`, `FileSystem`, `OperatingSystemUtils`, and `Platform` parameters across `getCurrentHostPlatform` and the build directory helper functions. The unreachable unsupported-host fallback in `getCurrentHostPlatform` no longer logs a warning.
Registers the remaining `AppContext`-backed services (`AndroidBuilder`, `AndroidValidator`, `ApplicationPackageFactory`, `AssetBundleFactory`, `DevtoolsLauncher`, `MDnsVmServiceDiscovery`, `Pub`, `TemplatePathProvider`, and `TestCompilerNativeAssetsBuilder`) in `runner.dart` gated by `!outerContext.hasOverride(...)` so CLI invocations without `runInContext` resolve them from `ToolDependencies` while preserving explicit ancestor overrides. Part of flutter#47161
…elete-globals-dart
Splits the `runner.dart`, `ToolDependencies.bootstrap`, `FlutterCommandRunner`, `AppContext`, and `native_assets` dependency injection refactors out into standalone PRs, narrowing this change to: - Migrating `bin/fuchsia_tester.dart` off `runInContext` and ambient `globals.*` to bootstrap `ToolDependencies` explicitly and accept an injected `ToolContext` in `run`, with hermetic coverage in `fuchsia_tester_test.dart`. - Replacing `context.get<Artifacts>()` in `Cache` with an injected `isLocalEngineBuilder` callback wired through `FlutterCache` and `ToolDependencies.bootstrap`. - Passing an explicit `AndroidContext` to `DoctorValidatorsProvider.create` and `DoctorCommand`, removing the ambient `androidLicenseValidator` and `visualStudioValidator` getters and their `runInContext` registrations. - Removing unused `PersistentToolState.instance`, `globals.isRunningOnBot`, `globals.fsUtils`, and `globals.printBox` helpers and migrating affected `daemon_test.dart`, `doctor_test.dart`, and `cache_test.dart` cases to `testWithoutContext`. Part of flutter#47161
…Context Revert unrelated globals.dart changes from this branch and isolate the PR to migrating bin/fuchsia_tester.dart off ambient globals and runInContext using explicit ToolContext and ToolDependencies.bootstrap injection, with an optional flutterRoot parameter on ToolDependencies.bootstrap and hermetic unit tests in test/general.shard/fuchsia_tester_test.dart. Part of flutter#47161
bkonyi
marked this pull request as ready for review
November 10, 2026 18:57
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors fuchsia_tester.dart to run hermetically without an ambient AppContext zone, passing dependencies via ToolContext and allowing ToolDependencies.bootstrap to accept an overridden flutterRoot. A regression was identified where the temporary directory tempDir is no longer deleted upon completion, potentially leaking temporary directories on the host machine.
chingjun
approved these changes
Nov 11, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Nov 11, 2026
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
Nov 12, 2026
flutter/flutter@b98afb5...9c427b5 2026-11-12 [email protected] Roll Skia from d67d0f22e3ec to 9aa2513a4ac9 (2 revisions) (flutter/flutter#196429) 2026-11-12 [email protected] [flutter_tools] Move CpuArch to flutter_tools_core and define HostPlatform by osName and cpuArch (flutter/flutter#195841) 2026-11-12 [email protected] Roll Skia from 23e7e63789b8 to d67d0f22e3ec (2 revisions) (flutter/flutter#196424) 2026-11-12 [email protected] Uber compactify (flutter/flutter#196392) 2026-11-12 [email protected] Roll Skia from 3d7e335da165 to 23e7e63789b8 (12 revisions) (flutter/flutter#196422) 2026-11-12 [email protected] Roll Dart SDK from 13af329ea4f2 to e5add7a25b32 (1 revision) (flutter/flutter#196413) 2026-11-12 [email protected] Don't terminate the shared EGL display when an engine is disposed (flutter/flutter#194520) 2026-11-11 [email protected] Adds manifest flag to turn on SDFs for Android. (flutter/flutter#196056) 2026-11-11 [email protected] Remove bringup from Linux_pixel_7pro integration_ui_keyboard_inset_jump (flutter/flutter#196334) 2026-11-11 [email protected] Uses system default locale for text rendering when preferred locale isn't supported (flutter/flutter#195997) 2026-11-11 [email protected] [android]: prewarms shaders when the context is created (flutter/flutter#196069) 2026-11-11 [email protected] iOS: Recomposite platform views only if their parameters change (flutter/flutter#196287) 2026-11-11 [email protected] [flutter_tools] Forward encoding in ErrorHandlingFile.readAsStringSync (flutter/flutter#196136) 2026-11-11 [email protected] Roll Skia from b89c24bbab8c to 3d7e335da165 (8 revisions) (flutter/flutter#196390) 2026-11-11 [email protected] Add Flutter Gardener instructions on how to disable a test (flutter/flutter#196312) 2026-11-11 [email protected] [Impeller] Enable malioc analysis for framebuffer_blend shaders (flutter/flutter#196343) 2026-11-11 [email protected] [flutter_tools] Migrate general.shard Android, asset, and build tests off globals (flutter/flutter#196125) 2026-11-11 [email protected] Roll Dart SDK from 8f15c4ca2d41 to 13af329ea4f2 (1 revision) (flutter/flutter#196386) 2026-11-11 [email protected] [Impeller] Do not clamp the local coverage limit to the root render target (flutter/flutter#195860) 2026-11-11 [email protected] [Impeller] Use separate uniform buffers on VMware SVGA3D (flutter/flutter#196022) 2026-11-11 [email protected] [flutter_tools] Introduce AndroidSdkProvider for lazy native_assets SDK lookup (flutter/flutter#196122) 2026-11-11 [email protected] Moves linux to ThinLTO. (flutter/flutter#196314) 2026-11-11 [email protected] [flutter_tools] Migrate bin/fuchsia_tester.dart off globals and runInContext (flutter/flutter#196074) 2026-11-11 [email protected] Changes the tolerances for frame_rate_main_test.dart. (flutter/flutter#196304) 2026-11-11 [email protected] Roll Packages from 08faf64 to 653628e (16 revisions) (flutter/flutter#196381) 2026-11-11 [email protected] Allow SliverCrossAxisGroup children to lay out with zero cross-axis extent instead of asserting (flutter/flutter#191287) 2026-11-11 [email protected] Roll Skia from cc4c54f752ba to b89c24bbab8c (4 revisions) (flutter/flutter#196375) 2026-11-11 [email protected] [Linux] Fix layer offset when compositing with glBlitFramebuffer (flutter/flutter#196189) 2026-11-11 [email protected] [flutter_tools] Inject CrashReportSender into SwiftPM migration (flutter/flutter#196315) 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
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.
Migrates
bin/fuchsia_tester.dartoff ambientglobalsandrunInContextto explicitToolContextandToolDependencies.bootstrapdependency injection:flutterRootparameter toToolDependencies.bootstrapsobin/fuchsia_tester.dartcan resolveCache.flutterRootfrom the parsed--packagesfile before bootstrapping dependencies.ToolContext(fs,logger,platform,processManager,cache,artifacts,os,config,botDetector,terminal,stdio,plistParser,processUtils,signals,xcodeProjectInterpreter) intobin/fuchsia_tester.dart(runandmain) instead of reading ambientglobals.*or wrapping execution inrunInContext.test/general.shard/fuchsia_tester_test.dartto construct a hermeticToolContextwithMemoryFileSystem,BufferLogger,FakeProcessManager, andTestArtifactsinstead of usingtestUsingContextoverrides.Part of #47161