Skip to content

cc_library defines should reject dict argument #17553

@eustas

Description

@eustas

Description of the bug:

Currently if defines value is dict, then compilation result is somewhat unexpected.
Bazel should report that list argument type is expected (as stated in docs).
It it likely that argument is used as array-like and dict keys are transformed to compiler options.

Alternative: allow dict argument, but transform entires to -Dkey=value

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Add to some cc_library: defines = {'KKKEEEYY': 'VALUE'}
  2. Search bazel build -c output for KKKEEEYYY.

Which operating system are you running Bazel on?

No response

What is the output of bazel info release?

release 6.0.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering working on this, but happy to review a PR. (No assignee)not staleIssues or PRs that are inactive but not considered staleteam-Rules-CPPIssues for C++ rulestype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions