Skip to content

Commit d504914

Browse files
authored
mobile: fix iOS build for open source contributors (#39649)
**Commit Message:** mobile: fix iOS build for open source contributors **Additional Description:** Me and another contributor were unable to build iOS from our machines as external contributors. This fixes the build. ~**1) XCode version:** The main change was to update the XCode version to ~16.3~ 16.1, since 15.3 is too old and no longer runs on modern macOS.~ Stopped forcing the old XCode version 15.3, allowing the developer to build on modern machines. ~**2) CI macos version:** The `macos-14` machine doesn't have XCode 16.3. We could use 16.2, but developers should not be using macOS 14 for security reasons, so migrating to `macos-15` better aligns with the developer environment.~. _Keeping macos-14 for now to make it work with the CI_ **3) Broken macros:** We also had to remove the C++17 override for iOS, since it was causing variadic macros to fail. Adding `--cxxopt=-Wno-error=variadic-macro-arguments-omitted` fixes the C++17 issue, but using C++20 is more sane and avoids loads of warnings. **4) MINIMUM_IOS_VERSION:** We also update `MINIMUM_IOS_VERSION` from 16.3 to 16.5. Without that the build was failing with: ``` In file included from external/envoy/source/common/json/json_streamer.h:11: external/envoy/source/common/buffer/buffer_util.h:46:40: error: 'to_chars' is unavailable: introduced in iOS 16.5 simulator    46 |     std::to_chars_result result = std::to_chars(buf, buf + sizeof(buf), number); ``` So the support for 16.3 was already absent. **5) Simulator version:** Stopped forcing the simulator version, which prevents running on platforms that don't have the exact version of the simulator required. **Risk Level:** Medium **Testing:** Built the xcframework: ```sh ./bazelw build ios_dist --config=ios ``` Ran the Swift app: ``` ./bazelw run //examples/swift/hello_world:app --config=ios ``` <img width="367" alt="image" src="https://github.com/user-attachments/assets/1114e625-e140-4673-acab-6bd332888463" /> Ran the Objective-C app: ``` ./bazelw run //examples/swift/hello_world:app --config=ios ``` I'm counting on the CI to run the tests. **Docs Changes:** None **Release Notes:** None **Platform Specific Features:** No new features. [Optional Runtime guard:] [Optional Fixes #Issue] [Optional Fixes commit #PR or SHA] [Optional Deprecated:] [Optional [API Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):] --------- Signed-off-by: Vinicius Fortuna <[email protected]>
1 parent a782b50 commit d504914

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

mobile/.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ build --features=swift.cacheable_swiftmodules
2121
build --features=swift.debug_prefix_map
2222
build --host_force_python=PY3
2323
build --macos_minimum_os=13.4
24-
build --ios_minimum_os=16.3
25-
build --ios_simulator_version=17.4
24+
# Use MINIMUM_IOS_VERSION in config.bzl instead
25+
# build --ios_minimum_os=16.3
2626
build --verbose_failures
2727
build --workspace_status_command=../bazel/get_workspace_status
2828
build --use_top_level_targets_for_symlinks

mobile/bazel/config.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Shared configuration for things we don't want to duplicate"""
22

3-
MINIMUM_IOS_VERSION = "16.3"
3+
MINIMUM_IOS_VERSION = "16.5"

mobile/ci/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ licenses(["notice"]) # Apache 2
33
xcode_version(
44
name = "xcode_16_1_0",
55
default_ios_sdk_version = "18.1",
6-
default_macos_sdk_version = "14.4",
7-
default_tvos_sdk_version = "17.4",
8-
default_watchos_sdk_version = "10.4",
6+
default_macos_sdk_version = "15.1",
7+
default_tvos_sdk_version = "18.1",
8+
default_watchos_sdk_version = "11.1",
99
version = "16.1",
1010
)
1111

0 commit comments

Comments
 (0)