mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-29 07:14:58 +01:00
Uses bazel 8 flags since there's the update in #4729. bazelisk was used to generate the list of flags (see bazelrc comment). The overall approach is trying to do our best to follow https://bazel.build/release/backward-compatibility, in particular since `--incompatible_strict_action_env` had come up (essentially just adopting as much as we can now). The default visibility changes in `carbon_rules/BUILD` and `cc_toolchains/BUILD` files are for `--incompatible_config_setting_private_default_visibility`. That's enough for fastbuild, but we use tcmalloc in opt, and it has an issue. In `clang_toolchain.BUILD` it's for `--incompatible_check_visibility_for_toolchains`, even though `rules_shell` then breaks on it. `manifest/defs.bzl` changes are for `--incompatible_disable_target_default_provider_fields` which `rules_pkg` breaks on. Even though these flags are off, I'm keeping the changes since we should eventually enable the flags. I'm still looking at the tree sitter rules due to the WORKSPACE issue, but I think that needs more substantial work.
49 lines
1.1 KiB
Python
49 lines
1.1 KiB
Python
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
# Exceptions. See /LICENSE for license information.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
load("@bazel_skylib//lib:selects.bzl", "selects")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
# For use by rules.bzl.
|
|
# Matches when asan is enabled on a macOS platform.
|
|
selects.config_setting_group(
|
|
name = "macos_asan",
|
|
match_all = [
|
|
":is_macos",
|
|
":macos_asan_build_modes",
|
|
],
|
|
)
|
|
|
|
# For use by rules.bzl.
|
|
# Matches macOS platforms.
|
|
config_setting(
|
|
name = "is_macos",
|
|
constraint_values = ["@platforms//os:osx"],
|
|
)
|
|
|
|
# For use by rules.bzl.
|
|
# Matches build modes where asan is enabled.
|
|
selects.config_setting_group(
|
|
name = "macos_asan_build_modes",
|
|
match_any = [
|
|
":dbg",
|
|
":fastbuild",
|
|
],
|
|
)
|
|
|
|
# For use by rules.bzl.
|
|
# Matches dbg.
|
|
config_setting(
|
|
name = "dbg",
|
|
values = {"compilation_mode": "dbg"},
|
|
)
|
|
|
|
# For use by rules.bzl.
|
|
# Matches fastbuild.
|
|
config_setting(
|
|
name = "fastbuild",
|
|
values = {"compilation_mode": "fastbuild"},
|
|
)
|