Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@ common --action_env=PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=upb
common --experimental_repo_remote_exec
common --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
common --cxxopt=-w --host_cxxopt=-w
# common --copt=-fbracket-depth=1024 --host_copt=-fbracket-depth=1024

common --define=grpc_no_ares=true
common --define=tsl_link_protobuf=true
common --define open_source_build=true
common
common --define framework_shared_object=true
common --define tsl_protobuf_header_only=true
common --define=allow_oversize_protos=true

common --enable_platform_specific_config

# macos specific config
build:macos --macos_minimum_os=11.3
build:macos --define using_clang=true
Copy link
Member

Choose a reason for hiding this comment

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

Technically one could compile with GCC on macOS.

Copy link
Member

Choose a reason for hiding this comment

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

I mean frankly the correct thing to do is to replace the using clang flag we added here with a detection of the compiler type from within Bazel and select based off that

Copy link
Member Author

Choose a reason for hiding this comment

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

using_clang is simply bumping up bracket-depth here

define_values = {"using_clang": "true"},

Copy link
Member Author

@vimarsh6739 vimarsh6739 Oct 22, 2025

Choose a reason for hiding this comment

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

@giordano @wsmoses What should I specify here for now then(default toolchain on mac is clang)?

Copy link
Member

Choose a reason for hiding this comment

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

default toolchain on mac is clang

"default" != "only option possible" (although perhaps that's what XLA wants you to believe)

Copy link
Member

Choose a reason for hiding this comment

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

@vimarsh6739 so higher level question, what are you trying to do with this here?

macos as a build clearly works since CI says it builds.

if the goal is to make it easier to build, I would replace the using_clang variable with an autodetection within bazel that determins if clang is being used, and adds the template copt automatically (so no one needs to manually specify using clang).


# Some targets have the same py source file, but use different
# configurations via `requires-` tags. This results in an action
Expand Down