Skip to content

[flutter_tools] Add flutter assemble support for tool extension assemble targets - #194563

Merged
auto-submit[bot] merged 41 commits into
flutter:masterfrom
bkonyi:ft-ext-step07c-assemble-host-integration
Nov 3, 2026
Merged

auto-submit[bot] merged 41 commits into
flutter:masterfrom
bkonyi:ft-ext-step07c-assemble-host-integration

Conversation

@bkonyi

@bkonyi bkonyi commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Integrates tool extension assemble targets (ExtensionAssembleTarget) into flutter assemble.

Part of #190755
Part of #190752

Pre-launch Checklist

bkonyi added 14 commits October 8, 2026 02:48
… targets

Extends `BuildService` and `package:flutter_tools_core` to support `flutter assemble` targets contributed by tool extensions (`ExtensionAssembleTarget`, `ExtensionTarget`, `ExtensionBuildContext`, `Source`, `Artifact`, `HostArtifact`, and `Target`), allowing extension targets to participate in the build graph alongside built-in targets.
Keep host Source and Target untouched in flutter_tools and convert extension Sources inside ExtensionAssembleTarget, reverting changes to built-in targets and Source.fromProject.
…le integration

- Prefix extension source and artifact types (`ExtensionSource`, `ExtensionArtifact`, `ExtensionHostArtifact`) and make `ExtensionSource` a sealed class.
- Keep `BuildMode` in `flutter_tools_core/lib/src/build.dart` and replace `SimpleTarget` with `BuiltInTargets` string constants.
- Revert host `build_system.dart` changes and rely on `-o` for `flutter assemble` output directories.
- Lazily query extension build targets in `AssembleCommand` only when a requested target is not built in, and remove duplicate Linux target entries.
- Trim AOT prototype targets and fix error handling and output draining in `flutter_tools_extension_linux_prototype`.
…rgetArtifacts

- Ignore `Exception` from `TargetPlatform.fromName(target.targetPlatform)` in `resolveExtensionTargetArtifacts` so custom embedder target platforms work without throwing `ToolExit`.
- Use `continue;` instead of `break;` on `ExtensionPatternSource` in `resolveExtensionTargetArtifacts`.
- Update unit and hermetic tests in `extension_test.dart` and `tool_extensions_build_test.dart`.
…ension PR reviews

- Prefix failure messages in `ExtensionAssembleTarget.build` with the target name and handle empty `errorMessage`.
- Remove `export 'src/build.dart';` from `flutter_tools_extension_linux_prototype.dart` so only `linuxExtensionEntryPoint` is exported.
- Expand Dartdoc on `targetPlatform`, `outputDir`, and `ExtensionSource.pattern`, and include all fields in `ExtensionBuildTarget.toString()`.
…lative extension outputDir

- Define `DependencyResolverCallback` for `ExtensionAssembleTarget._dependencyResolver`.
- Resolve relative `outputDir` paths against `projectDir` in `resolveExtensionOutputDir`.
…xpand source Dartdoc

- Replace top-level `k*Placeholder` constants with `BuiltInPlaceholders`.
- Add `See also:` cross-links on `ExtensionArtifact`, `ExtensionHostArtifact`, `ExtensionSource.pattern`, and `ExtensionPatternSource`.
- Expand Dartdoc on `ExtensionArtifactSource`, `ExtensionHostArtifactSource`, `ExtensionBuildTarget.outputs`, and `ExtensionBuildTarget.outputDir`.
…ild-remaining-slice

# Conflicts:
#	packages/flutter_tools/lib/src/commands/assemble.dart
…7c-assemble-host-integration

# Conflicts:
#	packages/flutter_tools/lib/src/build_system/targets/extension.dart
#	packages/flutter_tools/lib/src/commands/assemble.dart
#	packages/flutter_tools/lib/src/commands/build.dart
#	packages/flutter_tools/packages/flutter_tools_core/lib/src/build.dart
#	packages/flutter_tools/packages/flutter_tools_extension/lib/src/build.dart
#	packages/flutter_tools/test/commands.shard/hermetic/tool_extensions_build_test.dart
#	packages/flutter_tools/test/general.shard/build_system/targets/extension_test.dart
@bkonyi bkonyi added the CICD Run CI/CD label Oct 16, 2026
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. team-linux Owned by the Linux platform team labels Oct 16, 2026
…ctory URIs

Removes legacy BuildService.getBuildTargets and BuildService.build methods in favor of buildTargets and assembleTargets, normalizes directory URIs in ExtensionBuildContext to end with a trailing slash, and asserts JSON-RPC INVALID_PARAMS (-32602) on both build and assemble handlers.
…7c-assemble-host-integration

# Conflicts:
#	packages/flutter_tools/test/commands.shard/hermetic/tool_extensions_build_test.dart
… ExtensionTarget

Passes the resolved targetPlatform from ExtensionAssembleTarget as the fallback platform when mapping ExtensionArtifactSource to Source.artifact in _toHostSource, and adds test coverage for unknown dependency resolution in AssembleCommand.
…7c-assemble-host-integration

# Conflicts:
#	packages/flutter_tools/lib/src/build_system/targets/extension.dart
#	packages/flutter_tools/lib/src/experimental/extension_build_manager.dart
#	packages/flutter_tools/test/commands.shard/hermetic/tool_extensions_build_test.dart
…UTPUT_DIR}

Makes outputDir required on ExtensionBuildTarget and BuildTarget, requires name, description, and outputDir during JSON deserialization, and updates resolveExtensionOutputDir to resolve {OUTPUT_DIR} from the configured build directory.

Part of flutter#190755
…7c-assemble-host-integration

# Conflicts:
#	packages/flutter_tools/test/commands.shard/hermetic/tool_extensions_build_test.dart
Updates extension build target tests to specify outputDir with {OUTPUT_DIR} and verifies resolveExtensionOutputDir placeholder validation.

Part of flutter#190755
…ild-remaining-slice

# Conflicts:
#	packages/flutter_tools/packages/flutter_tools_core/lib/src/build.dart
#	packages/flutter_tools/packages/flutter_tools_extension/lib/src/build.dart
#	packages/flutter_tools/packages/flutter_tools_extension_linux_prototype/test/linux_build_test.dart
loic-sharma
loic-sharma previously approved these changes Oct 28, 2026

@loic-sharma loic-sharma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good to me, modulo comments

…iew comments

- Merge origin/master and resolve conflict in `ExtensionBuildManager._queryTargets`.

- Include conflicting extension names when skipping duplicate build/assemble targets or built-in target collisions, and include the extension name when `AssembleCommand` fails to resolve a missing dependency.

- Reject duplicate `ExtensionArtifactSource` inputs on the same `ExtensionAssembleTarget` when requested with different target platforms or build modes.

- Document out-of-tree `TargetPlatform` resolution behavior in `_tryResolveTargetPlatform`.
…test names

- Compare resolved artifact paths directly in `resolveExtensionAssembleTargetArtifacts` to avoid false conflicts across aliases or platform-agnostic artifacts.

- Return non-nullable `String` from `ExtensionBuildManager.extensionNameForBuildTarget` and `extensionNameForAssembleTarget`.

- Clarify `_tryResolveTargetPlatform` documentation for out-of-tree target platforms and use distinct extension names in `tool_extensions_build_test.dart`.
…mble-host-integration

# Conflicts:
#	packages/flutter_tools/lib/src/commands/assemble.dart
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…extension protocol (flutter#193984)

Defines `ExtensionAssembleTarget` and `AssembleTarget` in the extension
protocol, separating hermetic `flutter assemble` DAG targets from
top-level `flutter build` subcommand targets.

### Stack
1. **flutter#193984 (this PR)**
2. flutter#194563
([diff](bkonyi/flutter@ft-ext-step07b-build-remaining-slice...ft-ext-step07c-assemble-host-integration))

Part of flutter#190755
Part of flutter#190752

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [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] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
…mble-host-integration

# Conflicts:
#	packages/flutter_tools/test/commands.shard/hermetic/tool_extensions_build_test.dart
Throw a `ToolExit` when an `ExtensionArtifactSource` specifies an explicit `platform` that is not a built-in `TargetPlatform`, or when a target-platform-specific engine artifact resolves to a `null` target platform on an out-of-tree target.
@bkonyi
bkonyi requested a review from loic-sharma November 2, 2026 21:31
loic-sharma
loic-sharma previously approved these changes Nov 3, 2026
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 3, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 3, 2026
@auto-submit

auto-submit Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/194563, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

…mble-host-integration

# Conflicts:
#	packages/flutter_tools/lib/executable.dart
@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 3, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Nov 3, 2026
Merged via the queue into flutter:master with commit 319ffb4 Nov 3, 2026
34 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 3, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Nov 4, 2026
flutter/flutter@9347202...3623d2d

2026-11-04 [email protected] Roll Skia from 49ec2655bf51 to aaa39bfcd393 (5 revisions) (flutter/flutter#195956)
2026-11-04 [email protected] Roll pub packages (flutter/flutter#195950)
2026-11-04 [email protected] Roll pub packages (flutter/flutter#195948)
2026-11-04 [email protected] local_engine_builds_common out of bringup (flutter/flutter#195862)
2026-11-04 [email protected] [web][a11y] Initialize slider semantics values when enabling (flutter/flutter#195564)
2026-11-04 [email protected] Drop Android SDK, JDK, and Gradle dependencies from framework_tests_misc (flutter/flutter#195869)
2026-11-04 [email protected] Roll Fuchsia Test Scripts from B6zarykZp6PKWRueg... to Jo-ZgQSNDuPsjlZ4s... (flutter/flutter#195937)
2026-11-04 [email protected] Balance tool_tests_commands and web_tool_tests subshards by duration (flutter/flutter#195863)
2026-11-04 [email protected] Roll Fuchsia Linux SDK from T_-6-6X1lDMghhAvX... to p0HDXLISPIElJfSz7... (flutter/flutter#195939)
2026-11-03 [email protected] Roll Skia from 3eeafac94f07 to 49ec2655bf51 (8 revisions) (flutter/flutter#195933)
2026-11-03 [email protected] Roll pub packages (flutter/flutter#195932)
2026-11-03 [email protected] [flutter_tools] Lazily initialize AppleContext dependencies via builder closures (flutter/flutter#191992)
2026-11-03 [email protected] [Android] Upgrade linux_android_emu_vulkan_stable avd_cipd_version to 36.1.9 (build_id:8670032186093418337) (flutter/flutter#195856)
2026-11-03 [email protected] [vulkan]: adds "color attachment read" dst dependency to subpass (flutter/flutter#195714)
2026-11-03 [email protected] [flutter_tools] Stream web dev server proxy responses instead of buffering them (flutter/flutter#194934)
2026-11-03 [email protected] Roll Skia from d80db8f8f856 to 3eeafac94f07 (6 revisions) (flutter/flutter#195926)
2026-11-03 [email protected] [flutter_tools] Add flutter assemble support for tool extension assemble targets (flutter/flutter#194563)
2026-11-03 [email protected] Manual roll Dart SDK from fe609902984b to e362a23e9738 (2 revisions) (flutter/flutter#195914)
2026-11-03 [email protected] feat(flutter_test): add startHover and startHoverAt helper to WidgetTester (flutter/flutter#190630)
2026-11-03 [email protected] [flutter_tools] Remove trailing dots from bug report URLs (flutter/flutter#194132)
2026-11-03 [email protected] Update skills_lint to 0.5.3 (flutter/flutter#195796)
2026-11-03 [email protected] Roll Skia from 58295d932350 to d80db8f8f856 (5 revisions) (flutter/flutter#195900)
2026-11-03 [email protected] [flutter_tools] Make DeviceLogReader.dispose asynchronous (flutter/flutter#195389)
2026-11-03 [email protected] Roll Packages from 3f34a6f to 1df8447 (10 revisions) (flutter/flutter#195895)
2026-11-03 [email protected] Roll Skia from c733ad3e37cb to 58295d932350 (1 revision) (flutter/flutter#195894)

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
bkonyi added a commit to bkonyi/flutter that referenced this pull request Nov 4, 2026
Resolves merge conflicts with flutter#194563 squash commit on master and incorporates review polish:
- Handle null targetPlatform in resolveExtensionBuildTargetArtifacts error message
- Validate ExtensionAssembleTarget.depfiles entries as single non-empty file names
- Validate declared depfiles exist and parse cleanly in ExtensionTarget.build via DepfileService.resolve
- Support backslash-newline line continuations in ExtensionDepfile.parse
- Prevent ExtensionBuildResult.extraDefines from overwriting existing or reserved environment defines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD 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