Sitelet https://github.com/flutter/flutter/pull/189479
Skip to content

Split the platform and cpuArch part of TargetPlatform - #189479

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
chingjun:split-targetplatform
Jul 29, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:masterfrom
chingjun:split-targetplatform

Conversation

@chingjun

Copy link
Copy Markdown
Contributor

Convert enum TargetPlatform into a class with two fields: TargetPlatformType and CpuArch.

@chingjun chingjun added the CICD Run CI/CD label Jul 14, 2026
@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 Jul 14, 2026
@chingjun
chingjun force-pushed the split-targetplatform branch 3 times, most recently from 353f585 to 622ff1d Compare July 15, 2026 21:25
@chingjun

Copy link
Copy Markdown
Contributor Author

Note that this PR is stacked on top of #189478 and #189315. For easier review, please only look at the top commit. Thanks!

@chingjun
chingjun marked this pull request as ready for review July 15, 2026 22:02
@chingjun
chingjun requested review from a team as code owners July 15, 2026 22:02
@chingjun
chingjun requested review from bkonyi and mboetger and removed request for a team and mboetger July 15, 2026 22:02

@bkonyi bkonyi 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.

LGTM overall! I'll approve once the comment is addressed.

.macos || .windows => true,
.linux => targetPlatform.cpuArch == .x64,
.unsupported => TargetPlatform.throwUnsupportedTarget(),
_ => false,

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.

I guess we should be avoiding introducing _ here and explicitly list the unsupported target platform types.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated to list all platforms here.

@chingjun
chingjun force-pushed the split-targetplatform branch 2 times, most recently from cc89597 to 9aed9ab Compare July 21, 2026 22:57
bkonyi
bkonyi previously approved these changes Jul 23, 2026
chingjun added 2 commits July 23, 2026 23:05
Convert `TargetPlatform` from an enum into an immutable class that
combines a `PlatformType` (OS / runtime family) with a `CpuArch` (CPU
architecture). This decouples the platform from the architecture, which
were previously conflated in enum values like `android_arm64` and
`darwin`.
@chingjun

Copy link
Copy Markdown
Contributor Author

@bkonyi This PR needs a reapproval after rebase. Thanks!

@jesswrd
jesswrd requested a review from bkonyi July 28, 2026 21:15
@chingjun chingjun added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 29, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Jul 29, 2026
Merged via the queue into flutter:master with commit ec66198 Jul 29, 2026
20 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 29, 2026
@chingjun

Copy link
Copy Markdown
Contributor Author

Reason for revert: Broke postsubmit test. See #190252

@chingjun chingjun added the revert Autorevert PR (with "Reason for revert:" comment) label Jul 30, 2026
@flutteractionsbot

Copy link
Copy Markdown
Contributor

Successfully created revert PR: #190258

@flutteractionsbot flutteractionsbot removed the revert Autorevert PR (with "Reason for revert:" comment) label Jul 30, 2026
pull Bot pushed a commit to Mu-L/flutter that referenced this pull request Jul 30, 2026
…r#190258)

Reverts: [Split the platform and cpuArch part of
TargetPlatform](flutter#189479)

Initiated by: @chingjun

Reason for reverting: Broke postsubmit test. See
flutter#190252

Original PR Author: @chingjun

Reviewed By: @bkonyi

The original PR description is provided below:

Convert `enum TargetPlatform` into a class with two fields:
`TargetPlatformType` and `CpuArch`.

Fixes: flutter#190252
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.

3 participants