Files
carbon-lang/bazel/carbon_rules/BUILD
T
Jon Ross-Perkins 8cac0c398a Enable as many bazel incompatible flags as possible. (#4761)
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.
2025-01-07 22:10:42 +00:00

27 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//rules:common_settings.bzl", "bool_flag")
package(default_visibility = ["//visibility:public"])
# Flag controlling whether the target config is used for the `carbon_*` Bazel
# rules. The default is to use the exec config as that is more correct in cases
# where the target config is not compatible with the exec (cross compiling), and
# for library users of Carbon likely the most efficient as it will provide an
# optimized toolchain.
#
# However, for building the Carbon project itself, this will roughly double the
# build cost by forcing a build in both target and exec config. As a consequence
# we disable the flag in the `.bazelrc` of the project for its builds.
bool_flag(
name = "use_target_config_carbon_rules",
build_setting_default = False,
)
config_setting(
name = "use_target_config_carbon_rules_config",
flag_values = {":use_target_config_carbon_rules": "True"},
)