diff --git a/engine/src/flutter/build/archives/BUILD.gn b/engine/src/flutter/build/archives/BUILD.gn index 809312c739..dd35d33fd7 100644 --- a/engine/src/flutter/build/archives/BUILD.gn +++ b/engine/src/flutter/build/archives/BUILD.gn @@ -21,7 +21,28 @@ generated_file("artifacts_entitlement_config") { } } -if (build_engine_artifacts && !is_android) { +# This target is used to build a zip archive (artifacts.zip) of host tools such +# as flutter_tester, the Dart kernel compiler, the impellerc shader compiler, +# and other tooling that is bundled in debug-mode host builds. +# +# For historical reasons, this bundle also includes gen_snapshot (which is a +# target-platform-specific binary) for desktop platforms, though the +# un-suffixed gen_snapshot is unused on macOS (gen_snapshot_arm64 and +# gen_snapshot_x64 are used in its place). +# +# Target-specific iOS artifacts.zip are produced in: +# //flutter/sky/tools/create_full_ios_framework.py +# +# Target-specific Android archives are produced in: +# //flutter/shell/platform/android:gen_snapshot +# +# macOS-specific gen_snapshot_arm64 and gen_snapshot_x64 are produced in: +# //flutter/sky/tools/create_macos_gen_snapshots.py +# +# TODO: https://github.com/flutter/flutter/issues/38935 +# Target-specific binaries such as gen_snapshot should be separated into a +# separate archive target from host binaries such as flutter_tester. +if (build_engine_artifacts) { zip_bundle("artifacts") { deps = [ "$dart_src/runtime/bin:gen_snapshot", diff --git a/engine/src/flutter/common/config.gni b/engine/src/flutter/common/config.gni index c587735b50..4f8f690811 100644 --- a/engine/src/flutter/common/config.gni +++ b/engine/src/flutter/common/config.gni @@ -162,9 +162,15 @@ if (flutter_prebuilt_dart_sdk) { # Flutter SDK artifacts should only be built when either doing host builds, or # for cross-compiled desktop targets. +# +# !is_android is necessary because of the way that Android 32-bit arm +# gen_snapshot is built on Windows using the host toolchain, since we have no +# 32-bit arm toolchain for Windows. See comments in //flutter/tools/gn for +# details. +# # TODO: We can't build the engine artifacts for arm (32-bit) right now; -# see https://github.com/flutter/flutter/issues/74322 +# see https://github.com/flutter/flutter/issues/74322. build_engine_artifacts = - flutter_build_engine_artifacts && + flutter_build_engine_artifacts && !is_android && (current_toolchain == host_toolchain || (is_linux && !is_chromeos && current_cpu != "arm") || is_mac || is_win)