cc_library defines should reject dict argument
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.
- Add to some cc_library:
defines = {'KKKEEEYY': 'VALUE'} - Search
bazel build -coutput forKKKEEEYYY.
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
Did you mean: defines = {'KKKEEEYY' : 'VALUE'}? : instead of ,
Right. Fixed description.
This is interesting, I assume it is not just defines attribute for cc_library that is affected but all string_list attributes on Starlark rules might have similar problem, will investigate further.
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
@bazelbuild/triage not stale