Skip to content

Commit 84db051

Browse files
authored
mobile: fix macos build for open source contributors (#39658)
Commit Message: fix macos build for open source contributors Additional Description: This PR fixes the build of the example `fetch_client` on macOS. - Adds an XCode version that can run on modern machines - Removes the C++17 restriction intended for Android that was breaking the build because of modern constructs. - Upgrades macos_minimum_os to 13.4 because it's using APIs not supported in older versions. - Adds the missing dependency on `CFNetwork` to `apple_proxy_resolution_lib`. Risk Level: Low Testing: Built and ran the fetch_client on macOS: ``` ./bazelw run //examples/cc/fetch_client -- https://google.com ``` Docs Changes: N/A Release Notes: Fixed library dependency that can prevent builds from succeeding. 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]> Signed-off-by: Vinicius Fortuna <[email protected]>
1 parent 64da631 commit 84db051

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

mobile/.bazelrc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ build --features=debug_prefix_map_pwd_is_dot
2020
build --features=swift.cacheable_swiftmodules
2121
build --features=swift.debug_prefix_map
2222
build --host_force_python=PY3
23-
build --macos_minimum_os=13.3
23+
build --macos_minimum_os=13.4
2424
build --ios_minimum_os=16.3
2525
build --ios_simulator_version=17.4
2626
build --verbose_failures
2727
build --workspace_status_command=../bazel/get_workspace_status
28-
build --xcode_version=15.3
2928
build --use_top_level_targets_for_symlinks
3029
build --experimental_repository_downloader_retries=2
3130
build --define=google_grpc=disabled
@@ -42,7 +41,7 @@ build --swiftcopt=-wmo
4241
build --repo_env=JAVA_HOME=../bazel_tools/jdk
4342
build --define disable_known_issue_asserts=true
4443
# Temporarily set to C++17 because Android NDK does not fully support C++20 yet.
45-
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
44+
build:android --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
4645
# Unset per_object_debug_info. Causes failures on Android Linux release builds.
4746
build --features=-per_object_debug_info
4847
# Suppress deprecated declaration warnings due to extensive transitive noise from protobuf.

mobile/ci/BUILD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
licenses(["notice"]) # Apache 2
22

3+
xcode_version(
4+
name = "xcode_16_1_0",
5+
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",
9+
version = "16.1",
10+
)
11+
312
xcode_version(
413
name = "xcode_15_3_0",
514
default_ios_sdk_version = "17.4",
@@ -13,6 +22,7 @@ available_xcodes(
1322
name = "local_xcodes",
1423
default = ":xcode_15_3_0",
1524
versions = [
25+
":xcode_16_1_0",
1626
":xcode_15_3_0",
1727
],
1828
)
@@ -21,6 +31,7 @@ available_xcodes(
2131
name = "remote_xcodes",
2232
default = ":xcode_15_3_0",
2333
versions = [
34+
":xcode_16_1_0",
2435
":xcode_15_3_0",
2536
],
2637
)

mobile/library/common/network/BUILD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ envoy_cc_library(
154154
],
155155
"//conditions:default": [],
156156
}),
157+
linkopts = select({
158+
"@envoy//bazel:apple": [
159+
"-framework CFNetwork",
160+
],
161+
"//conditions:default": [],
162+
}),
157163
repository = "@envoy",
158164
deps = select({
159165
"@envoy//bazel:apple": [

0 commit comments

Comments
 (0)