| Jan Schär | 219c2c6 | 2025-04-30 08:14:25 +0000 | [diff] [blame] | 1 | load("//osbase/build:def.bzl", "forward_impl") |
| 2 | |
| 3 | # This is a copy of ignore_unused_configuration_target from |
| 4 | # //osbase/build:def.bzl with specific settings for the protobuf toolchain. |
| 5 | _new_settings = { |
| 6 | "@io_bazel_rules_go//go/config:race": False, |
| 7 | "@io_bazel_rules_go//go/config:pure": False, |
| 8 | "@io_bazel_rules_go//go/config:static": False, |
| 9 | "@io_bazel_rules_go//go/config:tags": [], |
| 10 | |
| 11 | # These private configs show up because of a bug in rules_go, which is |
| 12 | # missing a non_go_tool_transition on the proto toolchain when |
| 13 | # --incompatible_enable_proto_toolchain_resolution is enabled. |
| 14 | "@io_bazel_rules_go//go/private/rules:original_pure": "", |
| 15 | "@io_bazel_rules_go//go/private/rules:original_tags": "", |
| 16 | } |
| 17 | |
| 18 | def _ignore_unused_configuration_impl(_settings, _attr): |
| 19 | return _new_settings |
| 20 | |
| 21 | _ignore_unused_configuration = transition( |
| 22 | implementation = _ignore_unused_configuration_impl, |
| 23 | inputs = [], |
| 24 | outputs = list(_new_settings.keys()), |
| 25 | ) |
| 26 | |
| 27 | ignore_unused_configuration_target = rule( |
| 28 | cfg = _ignore_unused_configuration, |
| 29 | implementation = forward_impl, |
| 30 | attrs = { |
| 31 | "dep": attr.label(mandatory = True), |
| 32 | }, |
| 33 | doc = """Applies ignore_unused_configuration transition to a target.""", |
| 34 | ) |