bazel: incompatible_disallow_data_transition: remove outdated "cfg = "data'" syntax

Description of the problem / feature request:

cfg = "data" is outdated syntax that was turned into a no-op in https://github.com/bazelbuild/bazel/commit/10a6130dbafdf4e5f61198bec08b88fe6d6381fe.

The functionality this was originally intended for will be provided by Starlark build configuration.

Feature requests: what underlying problem are you trying to solve with this feature?

Remove outdated code & clean up technical debt.

Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Support can already be toggled with --incompatible_disallow_data_transition:

$ cat testapp/rules.bzl
def _foo_rule_impl(ctx):
    return []

foo_rule = rule(
    implementation = _foo_rule_impl,
    attrs = {
        "data": attr.label_list(cfg = "data"),
    },
)

$ cat testapp/BUILD
load("//testapp:rules.bzl", "foo_rule")

foo_rule(
    name = "g",
)

$ bazel build //testapp:g --incompatible_disallow_data_transition=false  [default]
INFO: Build completed successfully, 1 total action

$ bazel build //testapp:g --incompatible_disallow_data_transition
ERROR: /workspace/testapp/rules.bzl:7:17: Traceback (most recent call last):
	File "/workspace/testapp/rules.bzl", line 4
		rule(implementation = _foo_rule_impl, a...")})
	File "/workspace/testapp/rules.bzl", line 7, in rule
		attr.label_list(cfg = "data")
Using cfg = "data" on an attribute is a noop and no longer supported. Please remove it.
You can use --incompatible_disallow_data_transition=false to temporarily disable this
check.
ERROR: Skipping '//testapp:g': error loading package 'testapp': Extension file
'testapp/rules.bzl' has errors
FAILED: Build did NOT complete successfully (1 packages loaded)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (17 by maintainers)

Commits related to this issue

Most upvoted comments

I tried to migrate earlier today, many of the projects from the link above have already been fixed, I’ve sent https://github.com/bazelbuild/intellij/pull/485 for review. Would it be possible to rerun the global presubmit with --incompatible_disallow_data_transition again?

I should have updated this thread before. I’ve been sending PRs over the last days/weeks. My Tensorflow PR was merged this night. I think IntelliJ/CLion is the last one. Thanks Vlad!