Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions ci/builders/mac_ios_engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
"ninja": {
"config": "ci/ios_debug",
"targets": [
"flutter/lib/snapshot:generate_snapshot_bins",
"flutter/shell/platform/darwin/ios:flutter_framework"
]
},
Expand Down Expand Up @@ -161,8 +162,8 @@
"ninja": {
"config": "ci/ios_profile",
"targets": [
"flutter/shell/platform/darwin/ios:flutter_framework",
"flutter/lib/snapshot:generate_snapshot_bin"
"flutter/lib/snapshot:generate_snapshot_bins",
"flutter/shell/platform/darwin/ios:flutter_framework"
]
},
"postsubmit_overrides": {
Expand Down Expand Up @@ -206,8 +207,8 @@
"ninja": {
"config": "ci/ios_release",
"targets": [
"flutter/shell/platform/darwin/ios:flutter_framework",
"flutter/lib/snapshot:generate_snapshot_bin"
"flutter/lib/snapshot:generate_snapshot_bins",
"flutter/shell/platform/darwin/ios:flutter_framework"
]
},
"postsubmit_overrides": {
Expand Down Expand Up @@ -349,6 +350,7 @@
"ninja": {
"config": "ci/ios_debug_extension_safe",
"targets": [
"flutter/lib/snapshot:generate_snapshot_bins",
"flutter/shell/platform/darwin/ios:flutter_framework"
]
},
Expand Down Expand Up @@ -395,8 +397,8 @@
"ninja": {
"config": "ci/ios_profile_extension_safe",
"targets": [
"flutter/shell/platform/darwin/ios:flutter_framework",
"flutter/lib/snapshot:generate_snapshot_bin"
"flutter/lib/snapshot:generate_snapshot_bins",
"flutter/shell/platform/darwin/ios:flutter_framework"
]
},
"postsubmit_overrides": {
Expand Down Expand Up @@ -442,8 +444,8 @@
"ninja": {
"config": "ci/ios_release_extension_safe",
"targets": [
"flutter/shell/platform/darwin/ios:flutter_framework",
"flutter/lib/snapshot:generate_snapshot_bin"
"flutter/lib/snapshot:generate_snapshot_bins",
"flutter/shell/platform/darwin/ios:flutter_framework"
]
},
"postsubmit_overrides": {
Expand Down
11 changes: 5 additions & 6 deletions lib/snapshot/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ group("generate_snapshot_bins") {
#
# For macOS target builds: needed for both target CPUs (arm64, x64).
# For iOS, Android target builds: all AOT target CPUs are arm/arm64.
if (host_os == "mac" && target_os == "mac") {
if (host_os == "mac" && (target_os == "mac" || target_os == "ios")) {
deps += [ ":create_macos_gen_snapshots" ]
} else if (host_os == "mac" &&
(target_cpu == "arm" || target_cpu == "arm64")) {
Expand Down Expand Up @@ -184,17 +184,16 @@ if (host_os == "mac" && target_os != "mac" &&
# to `gen_snapshot_arm64` or `gen_snapshot_x64` depending on the target
# platform.
#
# This target is used for builds targeting macOS.
if (host_os == "mac" && target_os == "mac") {
# This target is used for builds targeting iOS and macOS.
if (host_os == "mac" && (target_os == "mac" || target_os == "ios")) {
template("build_mac_gen_snapshot") {
assert(defined(invoker.host_arch))
host_cpu = invoker.host_arch

build_toolchain = "//build/toolchain/mac:clang_$host_cpu"
if (host_cpu == target_cpu) {
gen_snapshot_target_name = "gen_snapshot"
if (target_os == "mac" && host_cpu == target_cpu) {
gen_snapshot_target_name = "gen_snapshot_host_targeting_host"
} else {
gen_snapshot_target_name = "gen_snapshot"
}
gen_snapshot_target =
"$dart_src/runtime/bin:$gen_snapshot_target_name($build_toolchain)"
Expand Down
17 changes: 8 additions & 9 deletions sky/tools/create_full_ios_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,20 @@ def process_framework(args, dst, framework, framework_binary):

def generate_gen_snapshot(dst, x64_out_dir, arm64_out_dir):
if x64_out_dir:
_generate_gen_snapshot(x64_out_dir, os.path.join(dst, 'gen_snapshot_x64'))
x64_path = os.path.join(x64_out_dir, 'gen_snapshot_x64')
_generate_gen_snapshot(x64_path, os.path.join(dst, 'gen_snapshot_x64'))

if arm64_out_dir:
_generate_gen_snapshot(
os.path.join(arm64_out_dir, 'clang_x64'), os.path.join(dst, 'gen_snapshot_arm64')
)
arm64_path = os.path.join(arm64_out_dir, 'gen_snapshot_arm64')
_generate_gen_snapshot(arm64_path, os.path.join(dst, 'gen_snapshot_arm64'))


def _generate_gen_snapshot(directory, destination):
gen_snapshot_dir = os.path.join(directory, 'gen_snapshot')
if not os.path.isfile(gen_snapshot_dir):
print('Cannot find gen_snapshot at %s' % gen_snapshot_dir)
def _generate_gen_snapshot(gen_snapshot_path, destination):
if not os.path.isfile(gen_snapshot_path):
print('Cannot find gen_snapshot at %s' % gen_snapshot_path)
sys.exit(1)

subprocess.check_call(['xcrun', 'bitcode_strip', '-r', gen_snapshot_dir, '-o', destination])
subprocess.check_call(['xcrun', 'bitcode_strip', '-r', gen_snapshot_path, '-o', destination])


if __name__ == '__main__':
Expand Down