You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Selectors behave oddly in the type checker: they can be used in place of a string, label, or list, but they cannot be used as a string or label in a list.
Feature requests: what underlying problem are you trying to solve with this feature?
We currently use a requirement() function to map a short name to a more complex py_library() in an external workspace. (This comes from the standard rules_python Pip repository rules.)
Changing the underlying implementation of requirement() to support multiple platforms with a select() in place of the simple string it currently returns is not possible. All users of the requirement() function need to be changed, for example as:
The short story is that selects today always bind to the attribute's type. So if the attribute is a label list the selectmust expand to a label list. #1623
talks about loosening that up some, I think to your satisfaction. There's already a prototype for it but it would take some more (still undone) work to make it production-ready.
Description of the problem / feature request:
Selectors behave oddly in the type checker: they can be used in place of a string, label, or list, but they cannot be used as a string or label in a list.
Feature requests: what underlying problem are you trying to solve with this feature?
We currently use a
requirement()
function to map a short name to a more complexpy_library()
in an external workspace. (This comes from the standardrules_python
Pip repository rules.)Changing the underlying implementation of
requirement()
to support multiple platforms with aselect()
in place of the simple string it currently returns is not possible. All users of therequirement()
function need to be changed, for example as:This is a potentially large undertaking, touching many BUILD files to work around a limitation in type checking.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
macOS 10.12
What's the output of
bazel info release
?release 0.18.0
Have you found anything relevant by searching the web?
All examples of
select()
seem to assume this behavior, or only use it in a non-list context.The text was updated successfully, but these errors were encountered: