From 2d5f61d6f10f4a55f7d6f94a93a806ffb4fe1595 Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 26 Jun 2026 07:50:25 +0800 Subject: [PATCH] Build iOS analyze snapshot in Apple CI --- .github/workflows/open-shorebird-ci.yml | 37 +++++++++++++++++++++---- scripts/verify_ci_workflow.rb | 7 ++++- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/workflows/open-shorebird-ci.yml b/.github/workflows/open-shorebird-ci.yml index 33f132c..58e9b8f 100644 --- a/.github/workflows/open-shorebird-ci.yml +++ b/.github/workflows/open-shorebird-ci.yml @@ -1314,7 +1314,8 @@ jobs: run: | ninja -C out/ios_release \ flutter/shell/platform/darwin/ios:flutter_framework \ - create_macos_gen_snapshots + create_macos_gen_snapshots \ + create_macos_analyze_snapshots - name: Verify iOS interpreter route run: ./scripts/verify_ios_interpreter_route.sh @@ -1353,10 +1354,36 @@ jobs: run: | set -euo pipefail mkdir -p artifacts/ios-engine/host_release_arm64 artifacts/ios-engine/ios-release - test -x flutter/engine/src/out/host_release_arm64/gen_snapshot - test -d flutter/engine/src/out/ios_release/Flutter.xcframework - test -x flutter/engine/src/out/ios_release/universal/gen_snapshot_arm64 - test -x flutter/engine/src/out/ios_release/analyze_snapshot_arm64 + + require_path() { + local path="$1" + if [ ! -e "$path" ]; then + echo "missing required path: $path" >&2 + find flutter/engine/src/out/ios_release -maxdepth 3 \( -name 'Flutter*' -o -name '*snapshot*' \) -print >&2 || true + exit 1 + fi + } + + require_directory() { + require_path "$1" + if [ ! -d "$1" ]; then + echo "required path is not a directory: $1" >&2 + exit 1 + fi + } + + require_executable() { + require_path "$1" + if [ ! -x "$1" ]; then + echo "required path is not executable: $1" >&2 + exit 1 + fi + } + + require_executable flutter/engine/src/out/host_release_arm64/gen_snapshot + require_directory flutter/engine/src/out/ios_release/Flutter.xcframework + require_executable flutter/engine/src/out/ios_release/universal/gen_snapshot_arm64 + require_executable flutter/engine/src/out/ios_release/analyze_snapshot_arm64 cp -R flutter/engine/src/out/ios_release/Flutter.framework artifacts/ios-engine/ cp -R flutter/engine/src/out/ios_release/Flutter.xcframework artifacts/ios-engine/ cp flutter/engine/src/out/host_release_arm64/gen_snapshot artifacts/ios-engine/host_release_arm64/ diff --git a/scripts/verify_ci_workflow.rb b/scripts/verify_ci_workflow.rb index 33a9220..98b3031 100755 --- a/scripts/verify_ci_workflow.rb +++ b/scripts/verify_ci_workflow.rb @@ -1999,8 +1999,13 @@ assert!( run_text_by_job.fetch('ios-engine').include?('--no-prebuilt-dart-sdk') && run_text_by_job.fetch('ios-engine').include?("--gn-args='dart_dynamic_modules=false dart_enable_aot_patching=true dart_enable_shorebird_interpreter=true shorebird_use_interpreter=true flutter_prebuilt_dart_sdk=false'") && run_text_by_job.fetch('ios-engine').include?("--gn-args='flutter_prebuilt_dart_sdk=false'") && + run_text_by_job.fetch('ios-engine').include?('create_macos_gen_snapshots') && + run_text_by_job.fetch('ios-engine').include?('create_macos_analyze_snapshots') && run_text_by_job.fetch('ios-engine').include?('verify_ios_interpreter_route.sh') && - run_text_by_job.fetch('ios-engine').include?('test -x flutter/engine/src/out/host_release_arm64/gen_snapshot') && + run_text_by_job.fetch('ios-engine').include?('require_executable flutter/engine/src/out/host_release_arm64/gen_snapshot') && + run_text_by_job.fetch('ios-engine').include?('require_directory flutter/engine/src/out/ios_release/Flutter.xcframework') && + run_text_by_job.fetch('ios-engine').include?('require_executable flutter/engine/src/out/ios_release/analyze_snapshot_arm64') && + run_text_by_job.fetch('ios-engine').include?('missing required path: $path') && run_text_by_job.fetch('ios-engine').include?('host_release_arm64/gen_snapshot') && run_text_by_job.fetch('ios-engine').include?('ios-release/artifacts.zip') && run_text_by_job.fetch('ios-engine').include?('mirror/shorebird/flutter_infra_release/flutter/${engine_revision}/ios-release/artifacts.zip') &&