Skip to content

Commit

Permalink
[macOS] Eliminate archive_gen_snapshot target (flutter#53948)
Browse files Browse the repository at this point in the history
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/e5215e6854bc61cf8d5bae48715d73293bc1f91c/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/e5215e6854bc61cf8d5bae48715d73293bc1f91c/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
  • Loading branch information
cbracken authored Jul 16, 2024
1 parent 5b9fc4e commit 119a057
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
16 changes: 0 additions & 16 deletions build/archives/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions ci/builders/mac_host_engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
]
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
]
},
Expand Down Expand Up @@ -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"
]
Expand Down

0 comments on commit 119a057

Please sign in to comment.