How can I tell Which targets are executed (not skipped) when running bazel build with aspects

397 views Asked by At

As part of our efforts to create a bazel-maven transition interop tool (that creates maven sized jars from more granular sized bazel jars), we have written an aspect that runs on bazel build of the entire bazel repo and writes txt files outputs.

  1. We want to write these aspect outputs only for non-cashed targets.
  2. Even better will be to have a list at the end of the run that contains all the targets that were run (not skipped due to them being cached)

Are 1. and 2. possible?

1

There are 1 answers

0
Dmitry Lomov On

We want to write these aspect outputs only for non-cashed targets.

I am not 100% sure what you mean here. It is undetectable if the target was cached or not. However, output files will be cached. If you run the same build with the same aspect, only the files that are not up-to-date will be updated.

... to have a list at the end of the run that contains all the targets that were run

We have a flag --experimental_show_artifacts that prints you all the artifacts that were built.