Skip to content

Commit 512f11d

Browse files
iindykcopybara-github
authored andcommitted
Fix macos linking errors by forcing use of clang.
PiperOrigin-RevId: 886465318
1 parent 5080952 commit 512f11d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

grain/oss/build_whl.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,17 @@ main() {
2121
# Enable host OS specific configs. For instance, "build:linux" will be used
2222
# automatically when building on Linux.
2323
write_to_bazelrc "build --enable_platform_specific_config"
24+
write_to_bazelrc "build --verbose_failures"
2425
# Bazel 7.0.0 no longer supports dynamic symbol lookup on macOS. To resolve
2526
# undefined symbol errors in macOS arm64 builds, explicitly add the necessary
2627
# linker flags until dependencies are well defined. See
2728
# https://github.com/bazelbuild/bazel/issues/19730.
2829
write_to_bazelrc "build:macos --linkopt=-Wl,-undefined,dynamic_lookup"
2930
write_to_bazelrc "build:macos --host_linkopt=-Wl,-undefined,dynamic_lookup"
31+
# Force clang on macos. Otherwise we get linker errors described in
32+
# https://github.com/bazelbuild/bazel/issues/20838.
33+
write_to_bazelrc "build:macos --action_env=CC=clang"
34+
write_to_bazelrc "build:macos --action_env=CXX=clang++"
3035

3136
write_to_bazelrc "build --@rules_python//python/config_settings:python_version=${PYTHON_VERSION}"
3237
# Set platform-wise file extension for extension modules.

0 commit comments

Comments
 (0)