Skip to content

[flutter_tools] Add HostPlatform, ArtifactDependency, and ArtifactService to tool extensions - #195352

Merged
auto-submit[bot] merged 11 commits into
flutter:masterfrom
bkonyi:ft-ext-step10a-artifact-service
Nov 4, 2026
Merged

auto-submit[bot] merged 11 commits into
flutter:masterfrom
bkonyi:ft-ext-step10a-artifact-service

Conversation

@bkonyi

@bkonyi bkonyi commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Adds HostPlatform and ArtifactDependency to package:flutter_tools_core, ArtifactService to package:flutter_tools_extension, and LinuxArtifactService to package:flutter_tools_extension_linux_prototype so tool extensions can declare custom artifact dependencies over the extension protocol.

Part of #190755
Part of #190754

…vice to tool extensions

Adds `HostPlatform` and `ArtifactDependency` to `package:flutter_tools_core`, `ArtifactService` to `package:flutter_tools_extension`, and `LinuxArtifactService` to `package:flutter_tools_extension_linux_prototype` so tool extensions can declare custom artifact dependencies over the extension protocol.

Part of flutter#190755
Part of flutter#190754
@bkonyi bkonyi added the CICD Run CI/CD label Oct 26, 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 26, 2026
@bkonyi
bkonyi marked this pull request as ready for review October 26, 2026 20:35
@bkonyi
bkonyi requested a review from a team as a code owner October 26, 2026 20:35

@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 introduces artifact dependency management for Flutter tool extensions, adding HostPlatform and ArtifactDependency models to flutter_tools_core, an ArtifactService to flutter_tools_extension, and a prototype implementation for Linux. The review feedback identifies three issues: invalid Dart syntax in ArtifactDependency.toMap() that causes a compilation error, a constructor parameter mismatch in LinuxArtifactService also leading to a compilation error, and a logical gap in _normalizeTargetPlatform where platform names with architecture suffixes (like macos-arm64) are not normalized to darwin.

…_test

Remove the redundant `package:flutter_tools/src/base/os.dart` import in `extension_device_test.dart` after merging `origin/master`, as `HostPlatform` is re-exported by `package:flutter_tools_core/flutter_tools_core.dart`.
…fact-service

# Conflicts:
#	packages/flutter_tools/test/general.shard/extension_protocol/extension_device_test.dart
chingjun
chingjun previously approved these changes Oct 28, 2026
Re-exports `HostPlatform` from `package:flutter_tools_core/flutter_tools_core.dart` in `packages/flutter_tools/lib/src/base/os.dart` instead of declaring a `typedef`, avoiding `ambiguous_import` conflicts when importing both `os.dart` and `flutter_tools_core.dart`.
…fact-service

Adds the `artifact` service to the Linux prototype's `config.yaml` and to the `extension_discovery_test.dart` fixture as required by the manifest services check from flutter#194590, and fixes the `'artifacts'` namespace in the `ExtensionPackageConfig` docs.
chingjun
chingjun previously approved these changes Nov 2, 2026
loic-sharma
loic-sharma previously approved these changes Nov 3, 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 LGTM modulo nits!

… tighten artifact validation

Renames ArtifactService.downloadArtifacts to listRequiredArtifacts, makes _isValidSinglePathSegment private with an allowlist regular expression disallowing trailing dots, throws FormatException from ArtifactDependency.listFromJson on non-list or non-map payloads, asserts cliName ends with - in HostPlatform, and maps darwin to macos in ExtensionManager.hostPlatformName.

Part of flutter#190755
Part of flutter#190754
@bkonyi
bkonyi dismissed stale reviews from loic-sharma and chingjun via 698497c November 3, 2026 16:22
@bkonyi
bkonyi requested a review from loic-sharma November 3, 2026 17:05
loic-sharma
loic-sharma previously approved these changes Nov 4, 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.

LGTM!

…tifact-service

# Conflicts:
#	packages/flutter_tools/test/commands.shard/hermetic/tool_extensions_build_test.dart
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 4, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Nov 4, 2026
Merged via the queue into flutter:master with commit 8692f5e Nov 4, 2026
22 of 23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 4, 2026
criskell pushed a commit to criskell/flutter that referenced this pull request Nov 12, 2026
…tform by osName and cpuArch (flutter#195841)

Moves `CpuArch` to `package:flutter_tools_core` as an extensible
`@immutable final class` (re-exported from `build_info.dart`) and
updates `HostPlatform` to be defined by `osName` and `cpuArch`, exposing
`cpuArchName`, `cliName`, and `name` getters while validating
single-segment lowercase alphanumeric OS and architecture identifiers.
Replaces `CpuArch.fromHostPlatform` call sites with
`HostPlatform.cpuArch`.

### Stack
- flutter#195352 (merged)
- **flutter#195841 (this PR)**
- flutter#194588

Part of flutter#190755
Part of flutter#190754
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.

3 participants