Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
defer requirement() failure until build time (ali5h#51)
I'd like to use select() to conditionally include dependencies depending on platform, eg a py_binary with deps = select({ "@bazel_tools//src/conditions:host_windows": [ requirement("psutil"), requirement("pywin32"), ], "//conditions:default": [], }) Currently this doesn't work, as requirement() is executed on all platforms. This patch changes requirement() to return an invalid key instead of using fail(), which will allow such usages of select(). If the user specifies a requirement that was not listed in the requirements file, they should still get an error at build time which identifies the missing package.
- Loading branch information