atlassian / bazel-tools

Reusable bits for Bazel
Apache License 2.0
113 stars 36 forks source link

multirun: option to run commands in parallel #61

Closed kevingessner closed 5 years ago

kevingessner commented 5 years ago

Running commands sequentially is a good and safe default, but for some instances, running the commands in parallel is better: it reduces end-to-end runtime if the commands are long-running and independent. It's implemented with bash built-ins only (read, &, wait, etc) to avoid adding more deps. The output in parallel mode is changed slightly so each line can be traced back to its writer.

I've also added some tests of both the existing behavior and the new.