Issuing any of "bazel shutdown" or "bazel --batch" seem to cause action listeners to be unnecessarily re-executed even though compiles are not re-executed.
N/A
A sample workspace is attached. Our real use-case is running clang-tidy as an action_listener, which is much more costly.
Ubuntu-16.04
bazel info release?release 0.11.1
bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.N/A
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?N/A
No.
Sample workspace attached.
@dslomov seems skylark related? can you triage this issue please?
Friendly ping. Is any initial diagnosis available?
@c-parsons could you take a look?
Friendly ping. Is any initial diagnosis available?
Sorry for the delay on a response here, it fell off my radar.
buchgr@: I'm not sure how this is a skylark issue.
Shutting down a server (invoking shutdown or using --batch) means you lose incremental build-analysis information. (However, you don't lose all information about the action cache, which is materialized).
So, when you rerun the build, bazel regenerates the full action graph, but then acknowledges that some of the actions should hit cache (their inputs haven't changed, and their outputs are still present in your build output directory, so they shouldn't be rerun). It seems, however, that the action cache for extra actions is perhaps consistently invalid, which means that these actions are rerun.
So this is a matter of determining why the actions registered by extra_action are not appropriately cached on disk.
That said, action_listener is marked experimental , and we're currently investigating a deprecation plan for this rule, so I highly doubt we'll be able to prioritize this.
I did not check for changes that affect this but from some tests it looks like the issue has been fixed since version 3.4.0
I don't know what the deprecation plan for extra_actions is right now but I did quickly check some more cases and it looks like this is only fixed in the simplest of cases:
In addition to that, I have noticed that a re-execution can be forced by just touching a BUILD-file, not even requiring a "bazel shutdown".