Skip to content

Commit

Permalink
Rename target_compatible_with to internal_target_compatible_with in _…
Browse files Browse the repository at this point in the history
…rbe_config

This essentially the same patch as
9a2fbe2 except that it deals with
`target_compatible_with` instead of `exec_properties`.

The PR bazelbuild/bazel#10945 adds a new `target_compatible_with`
attribute to all rules. That includes repository rules. Currently the
patch fails in `//src/test/shell/bazel:bazel_bootstrap_distfile_test`.
The error complains about:

  Error in repository_rule: There is already a built-in attribute 'target_compatible_with' which cannot be overridden

Since the repository rule is abstracted by a macro, it should be
fairly safe to rename the attribute to
`internal_target_compatible_with`.
  • Loading branch information
philsc committed Sep 15, 2020
1 parent 9a2fbe2 commit b7b7e80
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rules/rbe_repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def _rbe_autoconfig_impl(ctx):
docker_tool_path = None

# Resolve default constraints if none set
target_compatible_with = ctx.attr.target_compatible_with
target_compatible_with = ctx.attr.internal_target_compatible_with
if not target_compatible_with:
target_compatible_with = _TARGET_COMPAT_WITH[os_family(ctx)]

Expand Down Expand Up @@ -844,7 +844,7 @@ _rbe_autoconfig = repository_rule(
"tag": attr.string(
doc = ("Optional. The tag of the image to pull, e.g. latest."),
),
"target_compatible_with": attr.string_list(
"internal_target_compatible_with": attr.string_list(
doc = ("The list of constraints that will be added to the " +
"toolchain in its target_compatible_with attribute. For " +
"example, [\"@bazel_tools//platforms:linux\"]."),
Expand Down Expand Up @@ -1199,7 +1199,7 @@ def rbe_autoconfig(
registry = registry,
repository = repository,
tag = tag,
target_compatible_with = target_compatible_with,
internal_target_compatible_with = target_compatible_with,
use_checked_in_confs = use_checked_in_confs,
use_legacy_platform_definition = use_legacy_platform_definition,
)

0 comments on commit b7b7e80

Please sign in to comment.