Skip to content

fix(bazel): build failures for macos#15500

Closed
jinseopkim0 wants to merge 18 commits intomainfrom
preview-kokoro-macos-1.27
Closed

fix(bazel): build failures for macos#15500
jinseopkim0 wants to merge 18 commits intomainfrom
preview-kokoro-macos-1.27

Conversation

@jinseopkim0
Copy link
Collaborator

@jinseopkim0 jinseopkim0 commented Sep 14, 2025

This change is Reviewable

This commit fixes the macOS Bazel build failures in Kokoro by:
1.  Disabling the experimental downloader config in .bazelrc. The build was attempting to download dependencies from an outdated mirror, which resulted in 404 errors.
2.  Re-enabling the default Apple C++ toolchain. The build was explicitly disabling the default toolchain without providing an alternative, which caused toolchain resolution errors. The original reason for disabling the toolchain, a gRPC incompatibility with Bazel 7 (as documented in #13311), is no longer relevant as the project now uses a version of gRPC that is compatible with Bazel 7.
This commit removes the dependency on  from .
This dependency is very old and is incompatible with modern Bazel's C++
toolchain resolution, especially when using bzlmod. Removing this
dependency allows Bazel to use its built-in toolchain configuration,
which should fix the toolchain resolution errors on macOS.

This change is part of the effort to get the macOS Kokoro CI builds working.
This commit updates the @rules_cc dependency to a modern version (0.9.0)
and updates the capture_build_info.bzl file to use the correct load
statements.

This change is necessary because modern versions of Bazel have
externalized the C++ rules into the @rules_cc repository.
This commit removes an outdated dependency fetching loop from the
ci/kokoro/macos/builds/bazel.sh script. The script was attempting to
fetch the C++ toolchain and other dependencies as external
repositories, which is incorrect for modern Bazel with bzlmod.

By removing this loop, we allow Bazel and bzlmod to handle dependency
resolution and toolchain configuration automatically.

The --toolchain_resolution_debug flag has been added to get more
information in case of further build failures.

This commit also disables the -Werror flag for the boringssl library
for all builds. This is necessary to resolve a compilation error
caused by a conflict between the boringssl headers and a
system-installed version of OpenSSL on macOS.
This commit adds the -nostdinc flag to the boringssl dependency in
MODULE.bazel. This is necessary to prevent the compiler from finding a
system-installed version of OpenSSL on macOS, which was causing a
compilation failure due to header conflicts.
@jinseopkim0 jinseopkim0 deleted the preview-kokoro-macos-1.27 branch October 10, 2025 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant