From b6fa57dd2e7bfe565471c25bad4e51075c35720a Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Wed, 28 Jan 2026 15:05:26 -0500 Subject: [PATCH] [ Tool / Engine ] Cleanup x86 references (#181152) Fixes https://github.com/flutter/flutter/issues/170142 --- engine/src/build/toolchain/android/BUILD.gn | 4 - engine/src/flutter/assets/native_assets.cc | 2 - .../builders/linux_android_debug_engine.json | 44 ----------- engine/src/flutter/common/config.gni | 7 -- .../impeller/toolkit/interop/README.md | 1 - .../flutter/shell/platform/android/BUILD.gn | 76 +++++++++---------- .../lib/src/commands/run_command.dart | 2 - .../flutter_tool_interop/target_platform.dart | 4 - .../engine_tool/test/run_target_test.dart | 2 - packages/flutter_tools/lib/src/emulator.dart | 2 +- .../flutter_tools/lib/src/flutter_cache.dart | 1 - 11 files changed, 37 insertions(+), 108 deletions(-) diff --git a/engine/src/build/toolchain/android/BUILD.gn b/engine/src/build/toolchain/android/BUILD.gn index 1fd53092ddb..3a206ed1836 100644 --- a/engine/src/build/toolchain/android/BUILD.gn +++ b/engine/src/build/toolchain/android/BUILD.gn @@ -127,10 +127,6 @@ template("android_toolchains_helper") { } } -android_toolchains_helper("x86") { - toolchain_cpu = "x86" -} - android_toolchains_helper("arm") { toolchain_cpu = "arm" } diff --git a/engine/src/flutter/assets/native_assets.cc b/engine/src/flutter/assets/native_assets.cc index 28865f34a94..05b8eab20ee 100644 --- a/engine/src/flutter/assets/native_assets.cc +++ b/engine/src/flutter/assets/native_assets.cc @@ -13,8 +13,6 @@ namespace flutter { #define kTargetArchitectureName "arm" #elif defined(FML_ARCH_CPU_ARM64) #define kTargetArchitectureName "arm64" -#elif defined(FML_ARCH_CPU_X86) -#define kTargetArchitectureName "ia32" #elif defined(FML_ARCH_CPU_X86_64) #define kTargetArchitectureName "x64" #elif defined(FML_ARCH_CPU_RISCV32) diff --git a/engine/src/flutter/ci/builders/linux_android_debug_engine.json b/engine/src/flutter/ci/builders/linux_android_debug_engine.json index f0632b4578a..55e4e4bc90a 100644 --- a/engine/src/flutter/ci/builders/linux_android_debug_engine.json +++ b/engine/src/flutter/ci/builders/linux_android_debug_engine.json @@ -105,50 +105,6 @@ ] } }, - { - "archives": [ - { - "name": "ci/android_debug_x86", - "type": "gcs", - "base_path": "out/ci/android_debug_x86/zip_archives/", - "include_paths": [ - "out/ci/android_debug_x86/zip_archives/android-x86/artifacts.zip", - "out/ci/android_debug_x86/zip_archives/android-x86/android-x86-embedder.zip", - "out/ci/android_debug_x86/zip_archives/android-x86/impeller_sdk.zip", - "out/ci/android_debug_x86/zip_archives/android-x86/symbols.zip", - "out/ci/android_debug_x86/zip_archives/download.flutter.io" - ], - "realm": "production" - } - ], - "drone_dimensions": [ - "device_type=none", - "os=Linux" - ], - "gclient_variables": { - "use_rbe": true - }, - "gn": [ - "--target-dir", - "ci/android_debug_x86", - "--android", - "--android-cpu=x86", - "--no-lto", - "--rbe", - "--no-goma" - ], - "name": "ci/android_debug_x86", - "description": "Produces debug mode artifacts to target x86 Android from a Linux host.", - "ninja": { - "config": "ci/android_debug_x86", - "targets": [ - "flutter", - "flutter/shell/platform/android:abi_jars", - "flutter/shell/platform/embedder:embedder-archive", - "flutter/impeller/toolkit/interop:sdk" - ] - } - }, { "archives": [ { diff --git a/engine/src/flutter/common/config.gni b/engine/src/flutter/common/config.gni index 318d305bd37..051236c1584 100644 --- a/engine/src/flutter/common/config.gni +++ b/engine/src/flutter/common/config.gni @@ -115,14 +115,7 @@ if (_host_os_name == "mac") { _host_os_name = "windows" } -# When building 32-bit Android development artifacts for Windows host (like -# gen_snapshot), the host_cpu is set to x86. However, the correct prebuilt -# Dart SDK to use during this build is still the 64-bit one. _host_cpu = host_cpu -if (host_os == "win" && host_cpu == "x86") { - _host_cpu = "x64" -} - _target_prebuilt_config = "$_target_os_name-$target_cpu" _host_prebuilt_config = "$_host_os_name-$_host_cpu" diff --git a/engine/src/flutter/impeller/toolkit/interop/README.md b/engine/src/flutter/impeller/toolkit/interop/README.md index 6e75a53a117..841d1bd9f6e 100644 --- a/engine/src/flutter/impeller/toolkit/interop/README.md +++ b/engine/src/flutter/impeller/toolkit/interop/README.md @@ -36,7 +36,6 @@ The `$FLUTTER_SHA` is the Git hash in the [Flutter repository](https://github.co |:-----:|:------------:|:-----------:|:--------------:|:-------------:| | armv7 | | | android-arm | | | arm64 | darwin-arm64 | linux-arm64 | android-arm64 | windows-arm64 | -| x86 | | | android-x86 | | | x64 | darwin-x64 | linux-x64 | android-x64 | windows-x64 | diff --git a/engine/src/flutter/shell/platform/android/BUILD.gn b/engine/src/flutter/shell/platform/android/BUILD.gn index 68515f50fff..e485474eaf4 100644 --- a/engine/src/flutter/shell/platform/android/BUILD.gn +++ b/engine/src/flutter/shell/platform/android/BUILD.gn @@ -759,51 +759,49 @@ generated_file("android_entitlement_config") { deps = [] } -if (target_cpu != "x86") { - zip_bundle("gen_snapshot") { - gen_snapshot_out_dir = - get_label_info("$dart_src/runtime/bin:gen_snapshot($host_toolchain)", - "root_out_dir") +zip_bundle("gen_snapshot") { + gen_snapshot_out_dir = + get_label_info("$dart_src/runtime/bin:gen_snapshot($host_toolchain)", + "root_out_dir") - # The source gen_snapshot binary from the build outputs. - gen_snapshot_src = rebase_path("$gen_snapshot_out_dir/gen_snapshot") + # The source gen_snapshot binary from the build outputs. + gen_snapshot_src = rebase_path("$gen_snapshot_out_dir/gen_snapshot") - # The output gen_snapshot binary name in the archive. - gen_snapshot_dest = "gen_snapshot" + # The output gen_snapshot binary name in the archive. + gen_snapshot_dest = "gen_snapshot" - if (host_os == "mac") { - gen_snapshot_src = rebase_path("$root_out_dir/universal/gen_snapshot") - } else if (host_os == "win") { - gen_snapshot_src = rebase_path("$root_out_dir/gen_snapshot.exe") - gen_snapshot_dest = "gen_snapshot.exe" - } + if (host_os == "mac") { + gen_snapshot_src = rebase_path("$root_out_dir/universal/gen_snapshot") + } else if (host_os == "win") { + gen_snapshot_src = rebase_path("$root_out_dir/gen_snapshot.exe") + gen_snapshot_dest = "gen_snapshot.exe" + } - if (host_os == "linux") { - output = "$android_zip_archive_dir/linux-x64.zip" - } else if (host_os == "mac") { - output = "$android_zip_archive_dir/darwin-x64.zip" - } else if (host_os == "win") { - output = "$android_zip_archive_dir/windows-x64.zip" - } + if (host_os == "linux") { + output = "$android_zip_archive_dir/linux-x64.zip" + } else if (host_os == "mac") { + output = "$android_zip_archive_dir/darwin-x64.zip" + } else if (host_os == "win") { + output = "$android_zip_archive_dir/windows-x64.zip" + } - files = [ + files = [ + { + source = gen_snapshot_src + destination = gen_snapshot_dest + }, + ] + + deps = [ "//flutter/lib/snapshot:generate_snapshot_bins" ] + + if (host_os == "mac") { + deps += [ ":android_entitlement_config" ] + files += [ { - source = gen_snapshot_src - destination = gen_snapshot_dest + source = "$target_gen_dir/android_entitlements.txt" + destination = "entitlements.txt" }, ] - - deps = [ "//flutter/lib/snapshot:generate_snapshot_bins" ] - - if (host_os == "mac") { - deps += [ ":android_entitlement_config" ] - files += [ - { - source = "$target_gen_dir/android_entitlements.txt" - destination = "entitlements.txt" - }, - ] - } } } @@ -844,10 +842,8 @@ group("android") { ":android_javadoc", ":android_symbols", ":flutter_jar_zip", + ":gen_snapshot", ] - if (target_cpu != "x86") { - deps += [ ":gen_snapshot" ] - } } # Renames embedding android artifacts and places them in the final diff --git a/engine/src/flutter/tools/engine_tool/lib/src/commands/run_command.dart b/engine/src/flutter/tools/engine_tool/lib/src/commands/run_command.dart index d61bb5930b0..3f6bb9d6ecb 100644 --- a/engine/src/flutter/tools/engine_tool/lib/src/commands/run_command.dart +++ b/engine/src/flutter/tools/engine_tool/lib/src/commands/run_command.dart @@ -232,7 +232,6 @@ final class RunTarget { // ----------------------------------------------------------------------- // ANDROID TargetPlatform.androidUnspecified => 'android_$mode', - TargetPlatform.androidX86 => 'android_${mode}_x86', TargetPlatform.androidX64 => 'android_${mode}_x64', TargetPlatform.androidArm64 => 'android_${mode}_arm64', TargetPlatform.androidRiscv64 => 'android_${mode}_riscv64', @@ -291,7 +290,6 @@ final class RunTarget { // ----------------------------------------------------------------------- // ANDROID TargetPlatform.androidUnspecified || - TargetPlatform.androidX86 || TargetPlatform.androidX64 || TargetPlatform.androidRiscv64 || TargetPlatform.androidArm64 => [ diff --git a/engine/src/flutter/tools/engine_tool/lib/src/flutter_tool_interop/target_platform.dart b/engine/src/flutter/tools/engine_tool/lib/src/flutter_tool_interop/target_platform.dart index a34a51b3c75..db74dea5db3 100644 --- a/engine/src/flutter/tools/engine_tool/lib/src/flutter_tool_interop/target_platform.dart +++ b/engine/src/flutter/tools/engine_tool/lib/src/flutter_tool_interop/target_platform.dart @@ -29,9 +29,6 @@ final class TargetPlatform { /// Android x64. static const androidX64 = TargetPlatform._('android-x64'); - /// Android x86. - static const androidX86 = TargetPlatform._('android-x86'); - /// Linux ARM64. static const linuxArm64 = TargetPlatform._('linux-arm64'); @@ -92,7 +89,6 @@ final class TargetPlatform { androidArm64, androidRiscv64, androidX64, - androidX86, linuxArm64, linuxX64, windowsArm64, diff --git a/engine/src/flutter/tools/engine_tool/test/run_target_test.dart b/engine/src/flutter/tools/engine_tool/test/run_target_test.dart index 858db37a550..8ce7e30cf60 100644 --- a/engine/src/flutter/tools/engine_tool/test/run_target_test.dart +++ b/engine/src/flutter/tools/engine_tool/test/run_target_test.dart @@ -60,7 +60,6 @@ void main() { group('buildConfigFor', () { final Map expectedDebugTargets = { TargetPlatform.androidUnspecified: 'android_debug', - TargetPlatform.androidX86: 'android_debug_x86', TargetPlatform.androidX64: 'android_debug_x64', TargetPlatform.androidArm64: 'android_debug_arm64', TargetPlatform.androidRiscv64: 'android_debug_riscv64', @@ -98,7 +97,6 @@ void main() { TargetPlatform.androidUnspecified: [ Label.parseGn('//flutter/shell/platform/android:android_jar'), ], - TargetPlatform.androidX86: [Label.parseGn('//flutter/shell/platform/android:android_jar')], TargetPlatform.androidX64: [Label.parseGn('//flutter/shell/platform/android:android_jar')], TargetPlatform.androidArm64: [Label.parseGn('//flutter/shell/platform/android:android_jar')], TargetPlatform.androidRiscv64: [ diff --git a/packages/flutter_tools/lib/src/emulator.dart b/packages/flutter_tools/lib/src/emulator.dart index 1dbd5c9cbab..ecc572d4409 100644 --- a/packages/flutter_tools/lib/src/emulator.dart +++ b/packages/flutter_tools/lib/src/emulator.dart @@ -137,7 +137,7 @@ class EmulatorManager { error: 'No suitable Android AVD system images are available. You may need to install these' ' using sdkmanager, for example:\n' - ' sdkmanager "system-images;android-27;google_apis_playstore;x86"', + ' sdkmanager "system-images;android-34;google_apis_playstore;x86_64"', ); } diff --git a/packages/flutter_tools/lib/src/flutter_cache.dart b/packages/flutter_tools/lib/src/flutter_cache.dart index 31f5fbc825a..f5dab7e6366 100644 --- a/packages/flutter_tools/lib/src/flutter_cache.dart +++ b/packages/flutter_tools/lib/src/flutter_cache.dart @@ -891,7 +891,6 @@ const _iosBinaryDirs = >[ ]; const _androidBinaryDirs = >[ - ['android-x86', 'android-x86/artifacts.zip'], ['android-x64', 'android-x64/artifacts.zip'], ['android-arm', 'android-arm/artifacts.zip'], ['android-arm-profile', 'android-arm-profile/artifacts.zip'],