keith / rules_multirun

Bazel rules for running multiple commands in parallel in a single bazel invocation
Apache License 2.0
79 stars 16 forks source link

How to get commands from file? #28

Closed farcop closed 9 months ago

farcop commented 11 months ago
genrule(
    name = "commands_list",
    ...
)

multirun(
    name = "sign",
    commands = ":commands_list",
)

I thought it should be easy to do, but commands is a list of strings and I cant understand how to split genrule output to list.

keith commented 11 months ago

It's not possible to read files during the analysis phase in bazel. One option instead would be to create a repository_rule that reads the file and generates a BUILD file with each command you want