Skip to content

[flutter_tools] Wire project extension discovery, lazy service filtering, and custom create platforms - #194774

Draft
bkonyi wants to merge 65 commits into
flutter:masterfrom
bkonyi:ft-ext-phase01d-dynamic-discovery-wiring
Draft

bkonyi wants to merge 65 commits into
flutter:masterfrom
bkonyi:ft-ext-phase01d-dynamic-discovery-wiring

Conversation

@bkonyi

@bkonyi bkonyi commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #194772 and #194771
Diff against parent branch: bkonyi/flutter@ft-ext-phase01c-finder-and-compiler...ft-ext-phase01d-dynamic-discovery-wiring

Wire ProjectExtensionFinder and ExtensionKernelCompiler into ExtensionManager and ToolDependencies.bootstrap, remove the static linuxExtensionEntryPoint from executable.dart, add lazy requiredServices capability filtering to ExtensionManager.ensureInitialized, and support package:<ext>/... template resolution and custom --platforms in flutter create.

Stack

Part of #190755

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.

…tion, and safe mode

Introduce `ProjectExtensionFinder` (via `package:extension_discovery` and `extension/flutter_tools/config.yaml`), `ExtensionPackageConfig`, `ExtensionKernelCompiler` (`.dill` compilation with atomic writes and lockfiles), `--[no-]extensions` / `FLUTTER_NO_EXTENSIONS` safe mode, lazy capability filtering, and in-place `flutter create . --platforms=<custom>` support.
…onfig validation

- Acquire an exclusive lockfile (.dill.lock) via FileSystemLocking.runLocked and atomically rename temporary .dill.tmp and .d.tmp outputs in ExtensionKernelCompiler.compile.
- Ensure --extensions does not bypass FLUTTER_NO_EXTENSIONS=1 or enable tool extensions when the feature flag is disabled.
- Validate ExtensionPackageConfig.entrypoint against path traversal and filter platform template queries by requested custom platforms.
- Make FeatureFlags required on ExtensionManager and Artifacts required on ExtensionKernelCompiler, and refresh ExtensionBuildManager.getBuildTargets when new extension connections initialize.
… Isolate.spawnUri support

- Scope this branch to the ExtensionPackageConfig manifest model in flutter_tools_core, Isolate.spawnUri entrypoint support in flutter_tools_extension and flutter_tools_extension_linux_prototype, and ExtensionConnection.spawnUri in extension_discovery.dart.
- Split safe mode, ProjectExtensionFinder / ExtensionKernelCompiler, and dynamic discovery wiring into separate stacked PRs.
…mode

- Add the global --[no-]extensions CLI flag and FLUTTER_NO_EXTENSIONS=1 environment variable to bypass tool extension discovery and isolate spawning.
- Make FeatureFlags required on ExtensionManager and wire isSafeMode through ToolDependencies.bootstrap and FlutterFeatureFlags.isEnabled.
- Add ProjectExtensionFinder to discover tool extensions via package:extension_discovery and extension/flutter_tools/config.yaml filtered to direct project and Pub workspace dependencies.
- Add ExtensionKernelCompiler to compile extension entrypoints to .dill Kernel files with shared PUB_CACHE and workspace caching, --depfile invalidation, exclusive lockfiles, and atomic temporary file renames.
…ing, and custom create platforms

- Wire ProjectExtensionFinder and ExtensionKernelCompiler into ExtensionManager and ToolDependencies.bootstrap, and remove the static linuxExtensionEntryPoint from executable.dart.
- Add lazy requiredServices capability filtering to ExtensionManager.ensureInitialized across config, doctor, build, device, and template managers.
- Resolve package:<extension>/... template directories in ExtensionTemplateManager and support custom --platforms in flutter create.
bkonyi added 17 commits October 19, 2026 18:05
…1d-dynamic-discovery-wiring

# Conflicts:
#	packages/flutter_tools/lib/src/runner/flutter_command.dart
…date top-level flag collection

- Remove isToolExtensionsEnabledOverride from runner.dart, ToolDependencies.bootstrap, and FlutterFeatureFlags, reading --[no-]extensions from globalResults in ConfigCommand and DoctorCommand.
- Consolidate top-level CLI flag collection and option token skipping in FlutterCommandRunner.
bkonyi added 11 commits October 21, 2026 17:58
…1d-dynamic-discovery-wiring

# Conflicts:
#	packages/flutter_tools/lib/src/experimental/extension_discovery.dart
…rt disable lifecycle

In _optionTokenCount, fall back to checking the root argParser when an
option is not found in the current subcommand parser. This ensures global
options with value arguments passed after a subcommand consume their
arguments properly rather than treating the value as a subcommand name.

Also add an assertion to ExtensionManager.disable() to ensure disable()
cannot be called after initialization has started.

Part of flutter#190755
… clean up ignore comment

- Use a comma instead of a second `//` in the transitional suppression in
  `ExtensionManager.initialize()`:
  `// ignore: invalid_use_of_visible_for_testing_member, transitional until flutter#194774.`
- Drop `protocol_version` from `ExtensionPackageConfig`, its schema
  documentation, and the Linux prototype `config.yaml`. Protocol
  compatibility is governed by `package:flutter_tools_extension`
  dependency versions and no runtime protocol negotiation is performed.

Part of flutter#190755
Follows the parent change that dropped protocol_version from ExtensionPackageConfig.
…1d-dynamic-discovery-wiring

# Conflicts:
#	packages/flutter_tools/lib/src/experimental/extension_manager.dart
…nd trim config string lists

- Remove redundant `Isolate` type on initializing formal `this._isolate`.
- Trim `supportedPlatforms`, `services`, `buildTargets`, and `templates` in `ExtensionPackageConfig` constructor.

Part of flutter#190755
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-flutter__flutter that referenced this pull request Oct 21, 2026
…mode (flutter#194771)

Add the global `--[no-]extensions` CLI flag and
`FLUTTER_NO_EXTENSIONS=1` environment variable to bypass tool extension
discovery and isolate spawning, and require `FeatureFlags` on
`ExtensionManager`.

### Stack
- **PR 1A (parallel off `master`)**:
flutter#194590
(`ft-ext-phase01-03-project-discovery`)
- **PR 1B (this PR)**: flutter#194771
(`ft-ext-phase01b-safe-mode`)
- **PR 1C (stacked on 1A)**:
flutter#194772
(`ft-ext-phase01c-finder-and-compiler`)
- **PR 1D (stacked on 1B + 1C)**:
flutter#194774
(`ft-ext-phase01d-dynamic-discovery-wiring`)

Part of flutter#190755

## 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.
LongCatIsLooong pushed a commit to LongCatIsLooong/flutter that referenced this pull request Oct 22, 2026
…mode (flutter#194771)

Add the global `--[no-]extensions` CLI flag and
`FLUTTER_NO_EXTENSIONS=1` environment variable to bypass tool extension
discovery and isolate spawning, and require `FeatureFlags` on
`ExtensionManager`.

### Stack
- **PR 1A (parallel off `master`)**:
flutter#194590
(`ft-ext-phase01-03-project-discovery`)
- **PR 1B (this PR)**: flutter#194771
(`ft-ext-phase01b-safe-mode`)
- **PR 1C (stacked on 1A)**:
flutter#194772
(`ft-ext-phase01c-finder-and-compiler`)
- **PR 1D (stacked on 1B + 1C)**:
flutter#194774
(`ft-ext-phase01d-dynamic-discovery-wiring`)

Part of flutter#190755

## 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.
bkonyi added 14 commits October 22, 2026 22:17
…-project-discovery

# Conflicts:
#	packages/flutter_tools/packages/flutter_tools_core/lib/flutter_tools_core.dart
#	packages/flutter_tools/packages/flutter_tools_core/lib/src/json_utils.dart
#	packages/flutter_tools/packages/flutter_tools_core/test/json_utils_test.dart
…1d-dynamic-discovery-wiring

# Conflicts:
#	packages/flutter_tools/lib/src/experimental/extension_manager.dart
#	packages/flutter_tools/test/commands.shard/hermetic/tool_extensions_integration_test.dart
#	packages/flutter_tools/test/general.shard/extension_protocol/extension_manager_test.dart
Adds an explicit `trim` parameter to `stringSet` so trimming is no longer
implied by `rejectEmpty`. `ExtensionPackageConfig.fromMap` now passes
`trim: true` explicitly at each call site, and the doc comment describes
the trimming and empty element behavior.

Part of flutter#190755
…-project-discovery

# Conflicts:
#	packages/flutter_tools/lib/src/experimental/extension_discovery.dart
#	packages/flutter_tools/test/general.shard/extension_protocol/extension_discovery_test.dart
…y' into ft-ext-phase01c-finder-and-compiler

# Conflicts:
#	packages/flutter_tools/test/general.shard/extension_protocol/extension_discovery_test.dart
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…mode (flutter#194771)

Add the global `--[no-]extensions` CLI flag and
`FLUTTER_NO_EXTENSIONS=1` environment variable to bypass tool extension
discovery and isolate spawning, and require `FeatureFlags` on
`ExtensionManager`.

### Stack
- **PR 1A (parallel off `master`)**:
flutter#194590
(`ft-ext-phase01-03-project-discovery`)
- **PR 1B (this PR)**: flutter#194771
(`ft-ext-phase01b-safe-mode`)
- **PR 1C (stacked on 1A)**:
flutter#194772
(`ft-ext-phase01c-finder-and-compiler`)
- **PR 1D (stacked on 1B + 1C)**:
flutter#194774
(`ft-ext-phase01d-dynamic-discovery-wiring`)

Part of flutter#190755

## 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.
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
….spawnUri support (flutter#194590)

Introduce `ExtensionPackageConfig` in `package:flutter_tools_core` for
parsing `extension/flutter_tools/config.yaml` manifests,
`Isolate.spawnUri` entrypoint support in `ToolExtensionEntryPoint.run`
and `package:flutter_tools_extension_linux_prototype`, and
`ExtensionConnection.spawnUri` (with `expectedConfig` capability
validation) in `flutter_tools`.

### Stack
- **PR 1A (this PR)**: flutter#194590
(`ft-ext-phase01-03-project-discovery`)
- **PR 1B (merged)**: flutter#194771
(`ft-ext-phase01b-safe-mode`)
- **PR 1C (stacked on 1A)**:
flutter#194772
(`ft-ext-phase01c-finder-and-compiler`)
- **PR 1D (stacked on 1C)**:
flutter#194774
(`ft-ext-phase01d-dynamic-discovery-wiring`)

Part of flutter#190755

## 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.
bkonyi added a commit to bkonyi/flutter that referenced this pull request Nov 11, 2026
…ory-name entrypoint fallback in verifyExtensionPackage

- Drop hardcoded _builtInBuildSubcommands from verifyExtensionPackage (the host BuildCommand handles collisions dynamically).
- Drop the bin/<directory_name>.dart fallback in _resolveEntrypointUri (which fails in pub-cache versioned directories and differs from host resolution).
- Document error delivery on ExtensionTestHarness.onLog and add a TODO for removing expectedConfig after flutter#194774.
- Add test coverage for reserved extension.log RPC method registration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD team-linux Owned by the Linux 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.

1 participant