Skip to content

[Build] Upgrade rules_apple/apple_support and set macOS toolchain flags for Bazel 7#61695

Merged
aslonnie merged 2 commits intomasterfrom
andrew/revup/master/macos-apple-toolchain-bazel7
Mar 16, 2026
Merged

[Build] Upgrade rules_apple/apple_support and set macOS toolchain flags for Bazel 7#61695
aslonnie merged 2 commits intomasterfrom
andrew/revup/master/macos-apple-toolchain-bazel7

Conversation

@andrew-anyscale
Copy link
Contributor

@andrew-anyscale andrew-anyscale commented Mar 12, 2026

gRPC's grpc_deps() pulls in rules_apple 1.1.3 which uses
apple_common.multi_arch_split, removed in Bazel 7. Override to 3.2.1
(compatible with Bazel 6/7/8) before grpc_deps() runs so the maybe()
call is a no-op.

rules_apple 3.2.1 requires apple_support >= 1.11.1. Patch
is_xcode_at_least_version to return False instead of fail() on
CLT-only CI machines where xcode_config.xcode_version() is None.

Set BAZEL_NO_APPLE_CPP_TOOLCHAIN=1 to skip apple_cc_toolchain on
CLT-only machines where it would fail with "Xcode version must be
specified". Override -mmacosx-version-min to 12.0 to satisfy
std::filesystem and std::variant requirements (generic toolchain
defaults to 10.11).

Topic: macos-apple-toolchain-bazel7
Relative: protobuf-bazel7-exec-tools
Signed-off-by: andrew andrew@anyscale.com

@andrew-anyscale
Copy link
Contributor Author

andrew-anyscale commented Mar 12, 2026

Reviews in this chain:
#61694 [Build] Patch protobuf for Bazel 7 exec_tools removal
 └#61695 [Build] Upgrade rules_apple/apple_support and set macOS toolchain flags for Bazel 7
  └#61601 [Build] Upgrade Bazel from 6.5.0 to 7.5.0
   └#61725 [Build] Upgrade protobuf 28.2, absl 20240722.0, grpc 1.68.2, boringssl

@andrew-anyscale
Copy link
Contributor Author

andrew-anyscale commented Mar 12, 2026

# head base diff date summary
0 a8f15f83 6b48a596 diff Mar 12 12:49 PM 2 files changed, 37 insertions(+)
1 899eb2e7 6b48a596 diff Mar 12 12:55 PM 1 file changed, 18 insertions(+)
2 abcb022d ef49837f rebase Mar 12 13:08 PM 0 files changed
3 e74b48dc 1030fdc7 diff Mar 12 20:31 PM 0 files changed
4 5114f871 a99eab44 rebase Mar 13 11:13 AM 0 files changed
5 4b753789 4134a22f rebase Mar 13 14:43 PM 0 files changed
6 bc015e04 e5f8806e rebase Mar 13 17:26 PM 0 files changed
7 8883f3c3 ca0a3175 rebase Mar 13 17:27 PM 0 files changed
8 23fb31c7 871d61ed rebase Mar 16 7:15 AM 0 files changed

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades rules_apple and apple_support to versions compatible with Bazel 7, and includes a patch to handle environments with only Xcode Command Line Tools installed. The changes are well-explained and appear correct. I've suggested a minor improvement for maintainability by using constants for versions and hashes in ray_deps_setup.bzl.

@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/macos-apple-toolchain-bazel7 branch from a8f15f8 to 899eb2e Compare March 12, 2026 19:55
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/protobuf-bazel7-exec-tools branch from 6b48a59 to ef49837 Compare March 12, 2026 20:08
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/macos-apple-toolchain-bazel7 branch from 899eb2e to abcb022 Compare March 12, 2026 20:08
@andrew-anyscale andrew-anyscale marked this pull request as ready for review March 13, 2026 00:47
@ray-gardener ray-gardener bot added the core Issues that should be addressed in Ray Core label Mar 13, 2026
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/macos-apple-toolchain-bazel7 branch from abcb022 to e74b48d Compare March 13, 2026 03:31
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/protobuf-bazel7-exec-tools branch 2 times, most recently from 1030fdc to a99eab4 Compare March 13, 2026 18:13
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/macos-apple-toolchain-bazel7 branch from e74b48d to 5114f87 Compare March 13, 2026 18:13
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/protobuf-bazel7-exec-tools branch from a99eab4 to 4134a22 Compare March 13, 2026 21:43
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/macos-apple-toolchain-bazel7 branch 2 times, most recently from 4b75378 to bc015e0 Compare March 14, 2026 00:27
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/protobuf-bazel7-exec-tools branch 2 times, most recently from e5f8806 to ca0a317 Compare March 14, 2026 00:27
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/macos-apple-toolchain-bazel7 branch from bc015e0 to 8883f3c Compare March 14, 2026 00:27
Bazel 7 removed the exec_tools attribute from genrule; patch protobuf's
BUILD files to use tools instead.

Topic: protobuf-bazel7-exec-tools
Relative: lzma-custom-build-file
Signed-off-by: andrew <andrew@anyscale.com>
…gs for Bazel 7

gRPC's grpc_deps() pulls in rules_apple 1.1.3 which uses
apple_common.multi_arch_split, removed in Bazel 7. Override to 3.2.1
(compatible with Bazel 6/7/8) before grpc_deps() runs so the maybe()
call is a no-op.

rules_apple 3.2.1 requires apple_support >= 1.11.1. Patch
is_xcode_at_least_version to return False instead of fail() on
CLT-only CI machines where xcode_config.xcode_version() is None.

Set BAZEL_NO_APPLE_CPP_TOOLCHAIN=1 to skip apple_cc_toolchain on
CLT-only machines where it would fail with "Xcode version must be
specified". Override -mmacosx-version-min to 12.0 to satisfy
std::filesystem and std::variant requirements (generic toolchain
defaults to 10.11).

Topic: macos-apple-toolchain-bazel7
Relative: protobuf-bazel7-exec-tools
Signed-off-by: andrew <andrew@anyscale.com>
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/protobuf-bazel7-exec-tools branch from ca0a317 to 871d61e Compare March 16, 2026 14:15
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/macos-apple-toolchain-bazel7 branch from 8883f3c to 23fb31c Compare March 16, 2026 14:15
Base automatically changed from andrew/revup/master/protobuf-bazel7-exec-tools to master March 16, 2026 17:59
@aslonnie aslonnie merged commit 2a5a446 into master Mar 16, 2026
5 checks passed
@aslonnie aslonnie deleted the andrew/revup/master/macos-apple-toolchain-bazel7 branch March 16, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants