diff --git a/.github/workflows/ios-build-test.yml b/.github/workflows/ios-build-test.yml index 972385eed..41d091ba1 100644 --- a/.github/workflows/ios-build-test.yml +++ b/.github/workflows/ios-build-test.yml @@ -9,8 +9,8 @@ on: jobs: build: name: Build and test iOS app - # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md - runs-on: macos-14 + # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md + runs-on: macos-15 timeout-minutes: 180 env: PERF_TEST: true @@ -65,7 +65,7 @@ jobs: - name: Setup iOS simulator env: DEVICE_NAME: "iPhone 16 Pro" - RUNTIME_SDK: "iphonesimulator18.2" + RUNTIME_SDK: "iphonesimulator18.5" run: | cd flutter/ios/ci_scripts/ && bash setup_simulator.sh open -a Simulator diff --git a/WORKSPACE b/WORKSPACE index dbcbc5c2f..a317f8851 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -26,6 +26,26 @@ tf_patch_finder( workspace_dir = __workspace_dir__, ) +# Override zlib and png version to make it compatible with Xcode 16.4 +http_archive( + name = "zlib", + build_file = "//third_party:zlib.BUILD", + sha256 = "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c", + strip_prefix = "zlib-1.3.1", + urls = [ + "https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz", + "https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz", + ], +) + +http_archive( + name = "png", + build_file = "//third_party:libpng.BUILD", + sha256 = "71158e53cfdf2877bc99bcab33641d78df3f48e6e0daad030afe9cb8c031aa46", + strip_prefix = "libpng-1.6.50", + urls = ["https://github.com/glennrp/libpng/archive/refs/tags/v1.6.50.tar.gz"], +) + load("@tf_patch_finder//:patch_win_arm64.bzl", "PATCH_FILE") http_archive( diff --git a/flutter/ios/ci_scripts/ci_post_clone.sh b/flutter/ios/ci_scripts/ci_post_clone.sh index e5ed0ca45..6c5ce3692 100755 --- a/flutter/ios/ci_scripts/ci_post_clone.sh +++ b/flutter/ios/ci_scripts/ci_post_clone.sh @@ -64,8 +64,11 @@ echo "$MC_LOG_PREFIX protobuf version:" && protoc --version brew install cocoapods || brew install cocoapods || brew install cocoapods echo "$MC_LOG_PREFIX cocoapods version:" && pod --version -echo "$MC_LOG_PREFIX python version:" && python3 --version -python3 -m pip install --break-system-packages \ +brew install python@3.14 || brew install python@3.14 || brew install python@3.14 +brew link --overwrite python@3.14 +echo "$MC_LOG_PREFIX python version:" && python3.14 --version + +python3.14 -m pip install --break-system-packages \ "numpy>=1.23,<2.0" \ "absl-py>=1.3,<2.0" diff --git a/third_party/BUILD b/third_party/BUILD new file mode 100644 index 000000000..e69de29bb diff --git a/third_party/libpng.BUILD b/third_party/libpng.BUILD new file mode 100644 index 000000000..7cd23fda3 --- /dev/null +++ b/third_party/libpng.BUILD @@ -0,0 +1,70 @@ +# Description: +# libpng is the official PNG reference library. + +licenses(["notice"]) # BSD/MIT-like license + +genrule( + name = "pnglibconf", + srcs = ["scripts/pnglibconf.h.prebuilt"], + outs = ["pnglibconf.h"], + cmd = "cp $(location scripts/pnglibconf.h.prebuilt) $(location pnglibconf.h)", +) + +config_setting( + name = "target_arm64", + constraint_values = ["@platforms//cpu:arm64"], +) + +# Apple iOS CPU-based config_settings to avoid host/target mix-ups under split transitions. +config_setting( + name = "cpu_ios_arm64", + values = {"cpu": "ios_arm64"}, +) + +cc_library( + name = "png", + srcs = [ + "png.c", + "pngdebug.h", + "pngerror.c", + "pngget.c", + "pnginfo.h", + ":pnglibconf", + "pngmem.c", + "pngpread.c", + "pngpriv.h", + "pngread.c", + "pngrio.c", + "pngrtran.c", + "pngrutil.c", + "pngset.c", + "pngstruct.h", + "pngtrans.c", + "pngwio.c", + "pngwrite.c", + "pngwtran.c", + "pngwutil.c", + ] + select({ + ":cpu_ios_arm64": [ + "arm/arm_init.c", + "arm/filter_neon_intrinsics.c", + "arm/palette_neon_intrinsics.c", + ], + "//conditions:default": [], + }), + hdrs = [ + "png.h", + "pngconf.h", + ], + includes = ["."], + linkopts = select({ + "@bazel_tools//src/conditions:windows": [], + "//conditions:default": ["-lm"], + }), + copts = select({ + ":cpu_ios_arm64": ["-DPNG_ARM_NEON_OPT=2"], + "//conditions:default": ["-DPNG_ARM_NEON_OPT=0"], + }), + visibility = ["//visibility:public"], + deps = ["@zlib//:zlib"], +) diff --git a/third_party/zlib.BUILD b/third_party/zlib.BUILD new file mode 100644 index 000000000..86a2b57f5 --- /dev/null +++ b/third_party/zlib.BUILD @@ -0,0 +1,33 @@ +# Minimal BUILD for zlib used by TensorFlow and this project. + +cc_library( + name = "zlib", + srcs = [ + "adler32.c", + "compress.c", + "crc32.c", + "deflate.c", + "gzclose.c", + "gzlib.c", + "gzread.c", + "gzwrite.c", + "infback.c", + "inflate.c", + "inffast.c", + "inftrees.c", + "trees.c", + "uncompr.c", + "zutil.c", + ], + hdrs = [ + "zconf.h", + "zlib.h", + ], + includes = ["."], + # On POSIX (darwin, linux, android) unistd.h exists; on Windows it doesn't. + copts = select({ + "@bazel_tools//src/conditions:windows": [], + "//conditions:default": ["-DZ_HAVE_UNISTD_H"], + }), + visibility = ["//visibility:public"], +)