Skip to content

rules_python fails with incompatible_disallow_struct_provider_syntax #1956

@comius

Description

@comius

🐞 bug report

Affected Rule

Whole repository.

Is this a regression?

It was probably there for a long time. Couple of months ago it was because using protobuf repository. However, last test shows they might have been reintroduced.

Description

Legacy struct provider have been deprecated (that is returning struct from a rule), Python repository is still using it and depends on repositories using them.

bazelbuild/bazel#7347

🔬 Minimal Reproduction

bazel build --incompatible_disallow_struct_provider_syntax //...

🔥 Exception or Error

https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/1808#018e1662-3419-48d7-82fe-fd08e2670eb9



(01:25:03) ERROR: /var/lib/buildkite-agent/builds/bk-docker-mdp7/bazel-org-repo-root/rules_python/tests/base_rules/py_test/BUILD.bazel:18:19: in py_test rule //tests/base_rules/py_test:test_mac_requires_darwin_for_execution_subject:
/var/lib/buildkite-agent/builds/bk-docker-mdp7/bazel-org-repo-root/rules_python/python/private/common/py_executable_bazel.bzl:108:18: Returning a struct from a rule implementation function is deprecated and will be removed soon. It may be temporarily re-enabled by setting --incompatible_disallow_struct_provider_syntax=false . See https://github.com/bazelbuild/bazel/issues/7347 for details.
(01:25:03) ERROR: /var/lib/buildkite-agent/builds/bk-docker-mdp7/bazel-org-repo-root/rules_python/tests/base_rules/py_test/BUILD.bazel:18:19: Analysis of target '//tests/base_rules/py_test:test_mac_requires_darwin_for_execution_subject' failed
(01:25:04) ERROR: Analysis of target '//tests/base_rules/py_test:test_mac_requires_darwin_for_execution' failed; build aborted: Analysis failed
(01:25:04) INFO: Elapsed time: 7.022s, Critical Path: 0.32s
(01:25:04) INFO: 362 processes: 149 remote cache hit, 213 internal.
(01:25:04) ERROR: Build did NOT complete successfully

🌍 Your Environment

Operating System:

Any

Output of bazel version:

The flag has been there since forever :)

Rules_python version:

Head

Anything else relevant?

rules_python are one of the very last users from the repositories we're testing for incompatible changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions