-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
The part of the build configuration that chooses the python major version can be either PY2, PY3, or unknown. Currently when it's set, it stays that way for all transitive deps. We should reset it across data deps.
The rationale is that you want to enforce (via any srcs_version attrs that are present) that the source files and libraries you depend on have the same version as you, but you don't want to require that of other python binaries that you invoke as a separate process.
Implementation wise, it's straightforward to do this for the case of a py_binary's data attr. It's not so clear how to do it when you have a src file generated by another type of rule, like a genrule or sh_binary. Would you have to attach the transition to all sorts of attributes, or is there a way to attach the transition to a particular entry of the py_binary's srcs based on the kind of rule that generates it? (Though conditioning on rule type rather than provider is a code smell too.) TBD.