Skip to content

Commit

Permalink
Use new apple_support toolchain on macOS (bazelbuild#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
keith authored Feb 17, 2023
1 parent 1e9c231 commit ca6c7c0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,26 @@ common --incompatible_allow_tags_propagation
# Fail if a glob doesn't match anything (https://github.com/bazelbuild/bazel/issues/8195)
build --incompatible_disallow_empty_glob

# Since there's no way to set the deployment version for swift_{binary,test},
# this forces all targets' minimum macOS to Catalina until Bazel CI has
# upgraded their Mac machines to Big Sur.
build --macos_minimum_os=10.15
build --macos_minimum_os=11.0

# Make sure no warnings slip into the C++ tools we vendor
build --features treat_warnings_as_errors

# The default strategy is worker, which has sandboxing disabled by default,
# which can hide issues with non-hermetic bugs.
build --worker_sandboxing

build --enable_platform_specific_config
build:macos --apple_crosstool_top=@local_config_apple_cc//:toolchain
build:macos --crosstool_top=@local_config_apple_cc//:toolchain
build:macos --host_crosstool_top=@local_config_apple_cc//:toolchain

# TODO: Remove once https://github.com/protocolbuffers/protobuf/commit/7bb756c1cc580380c689a9141b27e20c7a5d95f3 is in a release
build --per_file_copt="external/.*protobuf.*/src/google/protobuf/stubs/strutil.cc@-Wno-deprecated-declarations"
# TODO: Use --host_per_file_copt here once we drop bazel 5.x
build --host_cxxopt="-Wno-deprecated-declarations"

# TODO: Remove once https://github.com/protocolbuffers/protobuf/commit/85225b83c3386a282bf1e51f1be8bd2ad0bc45d0 is in a release
build --per_file_copt="external/.*protobuf.*/.*.cc@-Wno-unused-function"
# TODO: Use --host_per_file_copt here once we drop bazel 5.x
build --host_cxxopt="-Wno-unused-function"
3 changes: 3 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ use_repo(
"com_github_grpc_grpc_swift",
)

apple_cc_configure = use_extension("@build_bazel_apple_support//crosstool:setup.bzl", "apple_cc_configure_extension")
use_repo(apple_cc_configure, "local_config_apple_cc")

# Dev dependencies
bazel_dep(name = "stardoc", version = "0.5.3", dev_dependency = True, repo_name = "io_bazel_stardoc")
1 change: 1 addition & 0 deletions test/rules/action_command_line_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def _action_command_line_test_impl(ctx):
if action.argv[0] not in [
"/usr/bin/ar",
"external/local_config_cc/libtool",
"external/local_config_apple_cc/libtool",
]
]
if len(matching_actions) != 1:
Expand Down

0 comments on commit ca6c7c0

Please sign in to comment.