Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename target_compatible_with to internal_target_compatible_with in _rbe_config #913

Closed

Conversation

philsc
Copy link

@philsc philsc commented Sep 15, 2020

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.

@philsc
Copy link
Author

philsc commented Sep 15, 2020

I tried to test this change in a few ways, but I can't seem to make bazel not throw some kind of unrelated error. So I'm hoping that buildkite will tell me if I messed something up. My apologies.

On a related note, it looks like bazel imports version 3.1.0 of this repo. So the patch that I tested within the bazel repos actually looks differently than what you see in the PR here.

The 3.1.0 version of this patch:

diff --git a/rules/rbe_repo.bzl b/rules/rbe_repo.bzl
index a386010..faec7e6 100644
--- a/rules/rbe_repo.bzl
+++ b/rules/rbe_repo.bzl
@@ -817,7 +817,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(
             default = _RBE_UBUNTU_TARGET_COMPAT_WITH,
             doc = ("The list of constraints that will be added to the " +
                    "toolchain in its target_compatible_with attribute. For " +
@@ -1174,7 +1174,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,
     )

philsc added a commit to philsc/bazel that referenced this pull request Oct 23, 2020
The upcoming Incompatible Target Skipping patch (bazelbuild#10945) introduces a
new `target_compatible_with` attribute which clashes with one of the
custom attributes in the bazel-toolchains repo. This patch fixes the
clash so we can merge the Incompatible Target Skipping path.

This is essentially a backport of bazelbuild/bazel-toolchains#913.
philsc added a commit to philsc/bazel that referenced this pull request Oct 23, 2020
The upcoming Incompatible Target Skipping patch (bazelbuild#10945) introduces a
new `target_compatible_with` attribute which clashes with one of the
custom attributes in the bazel-toolchains repo. This patch fixes the
clash so we can merge the Incompatible Target Skipping path.

This is essentially a backport of bazelbuild/bazel-toolchains#913.
bazel-io pushed a commit to bazelbuild/bazel that referenced this pull request Oct 23, 2020
The upcoming Incompatible Target Skipping patch (#10945) introduces a
new `target_compatible_with` attribute which clashes with one of the
custom attributes in the bazel-toolchains repo. This patch fixes the
clash so we can merge the Incompatible Target Skipping path.

This is essentially a backport of bazelbuild/bazel-toolchains#913.
…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`.
@philsc philsc force-pushed the internal-target-compatible-with branch from b7b7e80 to 4ab93cf Compare October 28, 2020 15:00
@philsc
Copy link
Author

philsc commented Oct 28, 2020

This last push is a rebase.

@philsc
Copy link
Author

philsc commented Nov 2, 2020

Now that @katre fixed Incompatible Target Skipping via bazelbuild/bazel#12378, we don't need this patch anymore.

@philsc philsc closed this Nov 2, 2020
@philsc philsc deleted the internal-target-compatible-with branch November 2, 2020 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants