Skip to content

[tool] Migrate Cache.flutterRoot static state to instance configuration - #190795

Merged
auto-submit[bot] merged 13 commits into
flutter:masterfrom
bkonyi:di/25-cache-instance-refactor
Oct 30, 2026
Merged

auto-submit[bot] merged 13 commits into
flutter:masterfrom
bkonyi:di/25-cache-instance-refactor

Conversation

@bkonyi

@bkonyi bkonyi commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Replaces static Cache.flutterRoot state and ambient globals usage across Cache and its callers with instance configuration and explicit ToolContext dependency injection, and consolidates ToolContext parameter passing across call sites.

Part of #47161

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@github-actions github-actions Bot added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. platform-macos Building on or for macOS specifically platform-windows Building on or for Windows specifically platform-linux Building on or for Linux specifically a: desktop Running on desktop team-android Owned by Android platform team team-ios Owned by iOS platform team team-macos Owned by the macOS platform team team-windows Owned by the Windows platform team team-linux Owned by the Linux platform team labels Aug 8, 2026
@bkonyi
bkonyi force-pushed the di/25-cache-instance-refactor branch 7 times, most recently from 30b447a to 452b58e Compare August 12, 2026 18:40
@bkonyi bkonyi added the CICD Run CI/CD label Sep 2, 2026
@flutter-dashboard

Copy link
Copy Markdown

This pull request is not mergeable in its current state, likely because of a merge conflict. Pre-submit CI jobs were not triggered. Pushing a new commit to this branch that resolves the issue will result in pre-submit jobs being scheduled.

@github-actions github-actions Bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. d: examples Sample code and demos f: integration_test The flutter/packages/integration_test plugin and removed engine flutter/engine related. See also e: labels. labels Sep 3, 2026
@github-actions github-actions Bot removed a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. d: examples Sample code and demos f: integration_test The flutter/packages/integration_test plugin labels Sep 11, 2026
…e-refactor

# Conflicts:
#	packages/flutter_tools/lib/src/commands/build_swift_package.dart
#	packages/flutter_tools/lib/src/commands/create.dart
#	packages/flutter_tools/lib/src/commands/packages.dart
#	packages/flutter_tools/lib/src/context/tool_dependencies.dart
#	packages/flutter_tools/lib/src/ios/application_package.dart
#	packages/flutter_tools/lib/src/ios/mac.dart
#	packages/flutter_tools/lib/src/ios/xcode_build_settings.dart
#	packages/flutter_tools/lib/src/isolated/native_assets/test/native_assets.dart
#	packages/flutter_tools/lib/src/macos/build_macos.dart
#	packages/flutter_tools/lib/src/project.dart
#	packages/flutter_tools/lib/src/runner/flutter_command.dart
#	packages/flutter_tools/lib/src/tester/flutter_tester.dart
#	packages/flutter_tools/lib/src/xcode_project.dart
#	packages/flutter_tools/test/commands.shard/hermetic/build_swift_package_test.dart
#	packages/flutter_tools/test/general.shard/application_package_test.dart
#	packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart
#	packages/flutter_tools/test/general.shard/isolated/native_assets_test.dart
#	packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart
#	packages/flutter_tools/test/general.shard/project_test.dart
#	packages/flutter_tools/test/general.shard/xcode_project_test.dart
#	packages/flutter_tools/test/src/fakes.dart
…e-refactor

# Conflicts:
#	packages/flutter_tools/test/general.shard/ios/simulators_test.dart
#	packages/flutter_tools/test/general.shard/macos/xcode_test.dart
…e-refactor

# Conflicts:
#	packages/flutter_tools/lib/src/build_system/targets/native_assets.dart
#	packages/flutter_tools/lib/src/commands/build_ios_framework.dart
#	packages/flutter_tools/lib/src/commands/build_macos_framework.dart
#	packages/flutter_tools/lib/src/commands/build_swift_package.dart
#	packages/flutter_tools/lib/src/flutter_device_manager.dart
#	packages/flutter_tools/lib/src/ios/mac.dart
#	packages/flutter_tools/lib/src/ios/xcode_build_settings.dart
#	packages/flutter_tools/lib/src/macos/build_macos.dart
#	packages/flutter_tools/lib/src/macos/cocoapod_utils.dart
#	packages/flutter_tools/test/general.shard/macos/cocoapod_utils_test.dart
@bkonyi
bkonyi requested review from chingjun and removed request for a team, mboetger and vashworth October 28, 2026 20:12
…e-refactor

# Conflicts:
#	packages/flutter_tools/lib/src/build_system/targets/dart_plugin_registrant.dart
#	packages/flutter_tools/lib/src/commands/assemble.dart
#	packages/flutter_tools/lib/src/flutter_plugins.dart
#	packages/flutter_tools/lib/src/macos/cocoapod_utils.dart
#	packages/flutter_tools/lib/src/test/test_compiler.dart
#	packages/flutter_tools/test/general.shard/dart_plugin_test.dart
…e-refactor

# Conflicts:
#	packages/flutter_tools/lib/src/commands/build_macos.dart
#	packages/flutter_tools/lib/src/context/tool_dependencies.dart
#	packages/flutter_tools/lib/src/flutter_device_manager.dart
#	packages/flutter_tools/lib/src/xcode_project.dart
#	packages/flutter_tools/test/src/fake_build_command.dart
chingjun
chingjun previously approved these changes Oct 29, 2026
…e-refactor

# Conflicts:
#	packages/flutter_tools/lib/src/commands/build_ios.dart
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 30, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 30, 2026
Merged via the queue into flutter:master with commit 7dae021 Oct 30, 2026
33 of 34 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 30, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Oct 31, 2026
flutter/flutter@5e805bf...ee8b482

2026-10-31 [email protected] Roll Skia from 9bab765df357 to 607de4b035dc (1 revision) (flutter/flutter#195728)
2026-10-31 [email protected] Roll Skia from 284054bec98a to 9bab765df357 (2 revisions) (flutter/flutter#195726)
2026-10-31 [email protected] Roll Skia from 3a3f56f7ddd4 to 284054bec98a (1 revision) (flutter/flutter#195724)
2026-10-31 [email protected] Roll Skia from 466994d27b1e to 3a3f56f7ddd4 (1 revision) (flutter/flutter#195719)
2026-10-30 [email protected] Fix XcodeProjectInterpreter dependency cycle in flutter_tools (flutter/flutter#195694)
2026-10-30 [email protected] Document that Positioned also works inside an Overlay (flutter/flutter#190607)
2026-10-30 [email protected] Roll Skia from ce0b85b46db6 to 466994d27b1e (3 revisions) (flutter/flutter#195711)
2026-10-30 [email protected] Adds Vulkan sync validation test run (flutter/flutter#195596)
2026-10-30 [email protected] [Android] Let the raster thread use every core of a chip without little cores (flutter/flutter#195071)
2026-10-30 [email protected] Roll Skia from 121d04c01e2d to ce0b85b46db6 (6 revisions) (flutter/flutter#195699)
2026-10-30 [email protected] [web] Anchor platform view slots to top-left to fix RTL document layout (flutter/flutter#194601)
2026-10-30 [email protected] Update golden file testing docs (flutter/flutter#195449)
2026-10-30 [email protected] [tool] Migrate Cache.flutterRoot static state to instance configuration (flutter/flutter#190795)
2026-10-30 [email protected] Apply view metrics overrides below the framework (flutter/flutter#194311)
2026-10-30 [email protected] Roll Skia from c0c46ee9f938 to 121d04c01e2d (9 revisions) (flutter/flutter#195687)
2026-10-30 [email protected] Use uniforms in the Porter Duff blend shader instead of specialization constants (flutter/flutter#195458)
2026-10-30 [email protected] [flutter_tools] Inject dependencies into iOS, macOS, and Windows application packages (flutter/flutter#194047)

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
gmackall pushed a commit to gmackall/flutter that referenced this pull request Nov 3, 2026
…on (flutter#190795)

Replaces static `Cache.flutterRoot` state and ambient `globals` usage
across `Cache` and its callers with instance configuration and explicit
`ToolContext` dependency injection, and consolidates `ToolContext`
parameter passing across call sites.

Part of flutter#47161

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop CICD Run CI/CD platform-ios iOS applications specifically platform-linux Building on or for Linux specifically platform-macos Building on or for macOS specifically platform-windows Building on or for Windows specifically team-android Owned by Android platform team team-ios Owned by iOS platform team team-linux Owned by the Linux platform team team-macos Owned by the macOS platform team team-windows Owned by the Windows 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