keith / rules_multirun

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

Add command_with_transition macro. #18

Closed oxidase closed 1 year ago

oxidase commented 1 year ago

@keith I have prepared another PR that breaks the current behavior which forces commands to make a transition to the "opt" compilation mode. Such implicit transition requires rebuilds of dependencies if a non-"opt" mode is used for building and testing before running multirun targets. In my example building of an image is done in the default fastbuild mode:

bazel build --platforms //deploy:aws_batch //src:image -s
...
  bazel-out/darwin_arm64-fastbuild-ST-445ab20d0084/bin/src/layer.build)
# Configuration: 0bee61ed503b09c25677365e3af314e0bdc31e8c9a0fdadd7381edaeff2222ab
...

but deploying the pre-built image with a multirun rule deploy forces another rebuild in opt mode`

bazel build //deploy:aws_batch //src:deploy -s
...
  bazel-out/darwin_arm64-opt-ST-445ab20d0084/bin/src/layer.build)
# Configuration: 318688f3701ef1fef848ac612bbc338ed2687e6287631dbcfc5499a3febae5d0

which involves Docker create commands and takes some minutes.

The PR is similar to #17: