From 1635fcff66300d679cab2b959006c33126bdb951 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 27 Aug 2021 11:28:13 -0700 Subject: [PATCH 1/6] re-group snapshot targets --- BUILD.gn | 3 +-- lib/snapshot/BUILD.gn | 17 ++++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index f7f861a7e4a3e..019e38fa39f61 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -77,8 +77,7 @@ group("flutter") { # If enbaled, compile the SDK / snapshot. if (!is_fuchsia) { public_deps += [ - "//flutter/lib/snapshot:generate_snapshot_bin", - "//flutter/lib/snapshot:kernel_platform_files", + "//flutter/lib/snapshot:generate_snapshot_bins", ] if (_build_engine_artifacts) { diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 59d02e2631f64..b867bcf749f47 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -8,6 +8,13 @@ import("//flutter/common/config.gni") import("//flutter/lib/ui/dart_ui.gni") import("//third_party/dart/utils/compile_platform.gni") +group("generate_snapshot_bins") { + deps = [:"generate_snapshot_bin"] + if (host_os == "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { + deps += [ ":create_arm_gen_snapshot" ] + } +} + compiled_action("generate_snapshot_bin") { if (target_cpu == "x86" && host_os == "linux") { # By default Dart will create a 32-bit gen_snapshot host binary if the target @@ -22,7 +29,7 @@ compiled_action("generate_snapshot_bin") { platform_kernel = "$root_out_dir/flutter_patched_sdk/platform_strong.dill" inputs = [ platform_kernel ] - deps = [ ":kernel_platform_files" ] + deps = [ ":strong_platform" ] vm_snapshot_data = "$target_gen_dir/vm_isolate_snapshot.bin" vm_snapshot_instructions = "$target_gen_dir/vm_snapshot_instructions.bin" @@ -221,9 +228,6 @@ source_set("snapshot") { ":vm_snapshot_data_linkable", ":vm_snapshot_instructions_linkable", ] - if (host_os == "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { - deps += [ ":create_arm_gen_snapshot" ] - } sources = get_target_outputs(":isolate_snapshot_data_linkable") + get_target_outputs(":isolate_snapshot_instructions_linkable") + @@ -255,8 +259,3 @@ compile_platform("strong_platform") { "dart:core", ] } - -# Fuchsia's snapshot requires a different platform with extra dart: libraries. -group("kernel_platform_files") { - public_deps = [ ":strong_platform" ] -} From a6b787103df6f45cc39b1902577a232b7a47cb60 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 27 Aug 2021 11:29:10 -0700 Subject: [PATCH 2/6] typo fix --- lib/snapshot/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index b867bcf749f47..0c0b2cf3ef444 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -9,7 +9,7 @@ import("//flutter/lib/ui/dart_ui.gni") import("//third_party/dart/utils/compile_platform.gni") group("generate_snapshot_bins") { - deps = [:"generate_snapshot_bin"] + deps = [":generate_snapshot_bin"] if (host_os == "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { deps += [ ":create_arm_gen_snapshot" ] } From 09e1504974f91212ffa6c7df07dec279c7278b92 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 27 Aug 2021 11:31:44 -0700 Subject: [PATCH 3/6] format --- BUILD.gn | 4 +--- lib/snapshot/BUILD.gn | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 019e38fa39f61..e84bece9519de 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -76,9 +76,7 @@ group("flutter") { # If enbaled, compile the SDK / snapshot. if (!is_fuchsia) { - public_deps += [ - "//flutter/lib/snapshot:generate_snapshot_bins", - ] + public_deps += [ "//flutter/lib/snapshot:generate_snapshot_bins" ] if (_build_engine_artifacts) { public_deps += [ diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 0c0b2cf3ef444..670b43eb20330 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -9,7 +9,7 @@ import("//flutter/lib/ui/dart_ui.gni") import("//third_party/dart/utils/compile_platform.gni") group("generate_snapshot_bins") { - deps = [":generate_snapshot_bin"] + deps = [ ":generate_snapshot_bin" ] if (host_os == "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { deps += [ ":create_arm_gen_snapshot" ] } From 083931c295e4507370be433bdf76f7b34d2c14ab Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 27 Aug 2021 11:33:34 -0700 Subject: [PATCH 4/6] fix --- lib/snapshot/BUILD.gn | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 670b43eb20330..703b3d12a999c 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -9,7 +9,10 @@ import("//flutter/lib/ui/dart_ui.gni") import("//third_party/dart/utils/compile_platform.gni") group("generate_snapshot_bins") { - deps = [ ":generate_snapshot_bin" ] + deps = [ + ":generate_snapshot_bin", + kernel_platform_files + ] if (host_os == "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { deps += [ ":create_arm_gen_snapshot" ] } @@ -29,7 +32,7 @@ compiled_action("generate_snapshot_bin") { platform_kernel = "$root_out_dir/flutter_patched_sdk/platform_strong.dill" inputs = [ platform_kernel ] - deps = [ ":strong_platform" ] + deps = [ ":kernel_platform_files" ] vm_snapshot_data = "$target_gen_dir/vm_isolate_snapshot.bin" vm_snapshot_instructions = "$target_gen_dir/vm_snapshot_instructions.bin" @@ -259,3 +262,8 @@ compile_platform("strong_platform") { "dart:core", ] } + +# Fuchsia's snapshot requires a different platform with extra dart: libraries. +group("kernel_platform_files") { + public_deps = [ ":strong_platform" ] +} From 82924490be151a3dac40f38caadf20cce9ef5e80 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 27 Aug 2021 11:54:07 -0700 Subject: [PATCH 5/6] fix typo --- lib/snapshot/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 703b3d12a999c..b1a7527277759 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -11,7 +11,7 @@ import("//third_party/dart/utils/compile_platform.gni") group("generate_snapshot_bins") { deps = [ ":generate_snapshot_bin", - kernel_platform_files + ":kernel_platform_files" ] if (host_os == "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { deps += [ ":create_arm_gen_snapshot" ] From 231defaca7a25c03bdb045e5fea2b6d4b6a4d65a Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 27 Aug 2021 12:24:28 -0700 Subject: [PATCH 6/6] fix format --- lib/snapshot/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index b1a7527277759..825beee8127b9 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -11,7 +11,7 @@ import("//third_party/dart/utils/compile_platform.gni") group("generate_snapshot_bins") { deps = [ ":generate_snapshot_bin", - ":kernel_platform_files" + ":kernel_platform_files", ] if (host_os == "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { deps += [ ":create_arm_gen_snapshot" ]