Skip to content

No warning or error if an invalid target attribute is set to None #11000

@jmillikin-stripe

Description

@jmillikin-stripe

Description of the problem / feature request:

Given the following BUILD file:

cc_binary(
    name = "hello",            
    srcs = ["hello.c"],        
    no_such_attribute = None,
)

I would expect some sort of error to be printed. There is an error if the invalid attribute is set to some non-None value (0, False, whatever) but None is just silently ignored.

A warning would also be acceptable (backwards compatibility and all), maybe with a flag to make it a hard error (defaulting to true in the next breaking release).

This behavior happens for both built-in and Starlark-defined rules.

What operating system are you running Bazel on?

macOS

What's the output of bazel info release?

release 2.2.0

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)team-Rules-APIAPI for writing rules/aspects: providers, runfiles, actions, artifactstype: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions