Skip to content

fix(bazel): build failures for macos (targeted uninstall) #15517

Closed
jinseopkim0 wants to merge 27 commits intomainfrom
preview-kokoro-macos-targeted-uninstall-1.9
Closed

fix(bazel): build failures for macos (targeted uninstall) #15517
jinseopkim0 wants to merge 27 commits intomainfrom
preview-kokoro-macos-targeted-uninstall-1.9

Conversation

@jinseopkim0
Copy link
Collaborator

@jinseopkim0 jinseopkim0 commented Sep 15, 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 changed the title Preview kokoro macos targeted uninstall 1.9 fix(bazel): build failures for macos (targeted uninstall) Sep 15, 2025
@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.04%. Comparing base (7ec4475) to head (1defec5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15517   +/-   ##
=======================================
  Coverage   93.04%   93.04%           
=======================================
  Files        2403     2403           
  Lines      219626   219626           
=======================================
+ Hits       204348   204353    +5     
+ Misses      15278    15273    -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jinseopkim0 jinseopkim0 deleted the preview-kokoro-macos-targeted-uninstall-1.9 branch October 10, 2025 01:24
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.

2 participants