From 22116874ea7323ff158a2a0bc51838937d1f5185 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 16 Jul 2024 14:44:06 -0700 Subject: [PATCH] [macOS] Eliminate archive_gen_snapshot target (flutter/engine#53948) This target produced an unused zipfile named `gen_snapshot.zip` containing the `gen_snapshot_${target_arch}` binary for the current build's target architecture. The macOS recipe JSON produces the real `gen_snapshot.zip` that gets uploaded to the cloud bucket and pulled down by the tool. See: https://github.com/flutter/engine/blob/29a474fe3ece25567d823e64df56cae1e115ef3b/ci/builders/mac_host_engine.json#L555-L592 The recipe did, however, rely on the `archive_gen_snapshot` rule to ensure that the underlying `gen_snapshot` targets were actually built. See, for example: https://github.com/flutter/engine/blob/29a474fe3ece25567d823e64df56cae1e115ef3b/ci/builders/mac_host_engine.json#L45 A few benefits: * Eliminates an unnecessary zip operation. * Eliminates confusion from grepping for gen_snapshot.zip and finding the wrong location in the source. * Grepping for create_macos_gen_snapshots will turn up the usage in the JSON build file. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- engine/src/flutter/build/archives/BUILD.gn | 16 ---------------- .../src/flutter/ci/builders/mac_host_engine.json | 10 +++++----- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/engine/src/flutter/build/archives/BUILD.gn b/engine/src/flutter/build/archives/BUILD.gn index 0e327b4cf7..cdd9498189 100644 --- a/engine/src/flutter/build/archives/BUILD.gn +++ b/engine/src/flutter/build/archives/BUILD.gn @@ -272,23 +272,7 @@ if (host_os == "win") { } } -# Archives Flutter Mac Artifacts if (is_mac) { - zip_bundle("archive_gen_snapshot") { - deps = [ "//flutter/lib/snapshot:create_macos_gen_snapshots" ] - suffix = "-$flutter_runtime_mode" - if (flutter_runtime_mode == "debug") { - suffix = "" - } - output = "$full_platform_name$suffix/gen_snapshot.zip" - files = [ - { - source = "${root_out_dir}/gen_snapshot_${target_cpu}" - destination = "gen_snapshot_${target_cpu}" - }, - ] - } - group("flutter_embedder_framework") { deps = [ "//flutter/shell/platform/embedder:flutter_embedder_framework_archive", diff --git a/engine/src/flutter/ci/builders/mac_host_engine.json b/engine/src/flutter/ci/builders/mac_host_engine.json index 3e151824fd..a2f979bf4d 100644 --- a/engine/src/flutter/ci/builders/mac_host_engine.json +++ b/engine/src/flutter/ci/builders/mac_host_engine.json @@ -42,11 +42,11 @@ "ninja": { "config": "ci/host_debug", "targets": [ - "flutter/build/archives:archive_gen_snapshot", "flutter/build/archives:artifacts", "flutter/build/archives:dart_sdk_archive", "flutter/build/archives:flutter_embedder_framework", "flutter/build/dart:copy_dart_sdk", + "flutter/lib/snapshot:create_macos_gen_snapshots", "flutter/shell/platform/darwin/macos:zip_macos_flutter_framework", "flutter/tools/font_subset", "flutter:unittests" @@ -127,8 +127,8 @@ "config": "ci/host_profile", "targets": [ "flutter/build/dart:copy_dart_sdk", - "flutter/build/archives:archive_gen_snapshot", "flutter/build/archives:artifacts", + "flutter/lib/snapshot:create_macos_gen_snapshots", "flutter/shell/platform/darwin/macos:zip_macos_flutter_framework", "flutter:unittests" ] @@ -214,9 +214,9 @@ "ninja": { "config": "ci/host_release", "targets": [ - "flutter/build/archives:archive_gen_snapshot", "flutter/build/archives:artifacts", "flutter/build/dart:copy_dart_sdk", + "flutter/lib/snapshot:create_macos_gen_snapshots", "flutter/shell/platform/darwin/macos:zip_macos_flutter_framework", "flutter/tools/font_subset", "flutter:unittests" @@ -298,10 +298,10 @@ "config": "ci/mac_debug_arm64", "targets": [ "flutter/tools/font_subset", - "flutter/build/archives:archive_gen_snapshot", "flutter/build/archives:artifacts", "flutter/build/archives:dart_sdk_archive", "flutter/build/archives:flutter_embedder_framework", + "flutter/lib/snapshot:create_macos_gen_snapshots", "flutter/shell/platform/darwin/macos:zip_macos_flutter_framework" ] }, @@ -442,10 +442,10 @@ "config": "ci/mac_release_arm64", "targets": [ "flutter:unittests", - "flutter/build/archives:archive_gen_snapshot", "flutter/build/archives:artifacts", "flutter/build/dart:copy_dart_sdk", "flutter/impeller/golden_tests:impeller_golden_tests", + "flutter/lib/snapshot:create_macos_gen_snapshots", "flutter/shell/platform/darwin/macos:zip_macos_flutter_framework", "flutter/tools/font_subset" ]