-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
P4This is either out of scope or we don't have bandwidth to review a PR. (No assignee)This is either out of scope or we don't have bandwidth to review a PR. (No assignee)type: bug
Description
Description of the bug:
Given a target that returns the testing.TestEnvironment / TestEnvironmentInfo, that provider cannot be read from the target.
This makes it impossible to easily test that the rule constructs an appropriate TestEnvironmentInfo object.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
def _provides_info(ctx):
return [testing.TestEnvironment({})]
provides_info = rule(implementation = _provides_info)
def _reads_info(ctx):
print(ctx.attr.target[testing.TestEnvironment])
reads_info = rule(implementation=_reads_info, attrs={"target": attr.label()})
provides_info(name="provides")
reads_info(name="reads", target=":provides")
Actual behavior:
An error like below occurs:
Error: Type Target only supports indexing by object constructors, got builtin_function_or_method instead
Expected behavior:
The TestEnvironmentInfo provider instance is returned.
Which operating system are you running Bazel on?
Linux
What is the output of bazel info release?
google build
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
Google build
What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?
n/a
Have you found anything relevant by searching the web?
None found
Any other information, logs, or outputs that you want to share?
No response
brentleyjones and fmeum
Metadata
Metadata
Assignees
Labels
P4This is either out of scope or we don't have bandwidth to review a PR. (No assignee)This is either out of scope or we don't have bandwidth to review a PR. (No assignee)type: bug