Feature request: genrule with directory output / run_binary with command input
I'm interested in a rule that takes a shell command string as input like genrule but supports directories as outputs like run_binary. Would the maintainers of this library be receptive to a PR adding one?
My intuition would be to add a rule run_shell that shares a lot of the code of run_binary. But I can also imagine just adding a parameter to run_binary (incompatible with tool).
Yes, one can just use run_binary with sh_binary, but that requires to targets instead of one, plus a .sh file (or a third write_file target). If your script is more than a few lines, that's probably the better approach anyways, but it feels like a lot of boilerplate when I just want to do a simple transformation over an indeterminate number of files.
@fmeum any thoughts about this design shape? I can see the case for it, but also want to keep a minimal API surface.
@alexeagle I tend to agree. genrule but with output directories would be useful, but the best way to get it would be to add this functionality to genrule.
@barryam3 Have you checked whether there is a Bazel issue about this? If not, could you file one?
I think this is tracked in Bazel by https://github.com/bazelbuild/bazel/issues/19030
I'll go ahead and leave a comment on that issue.