Repository navigation
[flutter_tools] Add HostPlatform, ArtifactDependency, and ArtifactService to tool extensions - #195352
Merged
auto-submit[bot] merged 11 commits intoNov 4, 2026
Merged
Conversation
…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
marked this pull request as ready for review
October 26, 2026 20:35
Contributor
There was a problem hiding this comment.
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.
…n ArtifactDependency
…_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
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
previously approved these changes
Nov 2, 2026
loic-sharma
reviewed
Nov 3, 2026
loic-sharma
reviewed
Nov 3, 2026
loic-sharma
reviewed
Nov 3, 2026
loic-sharma
reviewed
Nov 3, 2026
loic-sharma
reviewed
Nov 3, 2026
loic-sharma
reviewed
Nov 3, 2026
loic-sharma
reviewed
Nov 3, 2026
… 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
…tifact-service # Conflicts: # packages/flutter_tools/test/commands.shard/hermetic/tool_extensions_build_test.dart
…nto ft-ext-step10a-artifact-service
loic-sharma
approved these changes
Nov 4, 2026
This was referenced Nov 5, 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
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.
Adds
HostPlatformandArtifactDependencytopackage:flutter_tools_core,ArtifactServicetopackage:flutter_tools_extension, andLinuxArtifactServicetopackage:flutter_tools_extension_linux_prototypeso tool extensions can declare custom artifact dependencies over the extension protocol.Part of #190755
Part of #190754