Finding root action in a build using execlog #20491
Unanswered
alfredomusumeci
asked this question in
Q&A
Replies: 1 comment
-
Update: bazel query 'rdeps' seems to be useful in doing what I want, except that it prints the transitive closure of all reversed dependencies, ie: say I see in the execlog a specific action with targetLabel //foo; //foo is not a target I created myself but it is an implicit one, I want to see where foo comes from. If I run bazel query 'rdeps(//..., //foo)' I will see all target labels that may lead to foo being executed, however, there are two things that are not quite what I want for my use case:
Is there any way to achieve this desired behaviour? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When running bazel test with exec log enabled, an output file is produced listing all actions that took place during the build. It is a fact that an action may trigger another action, which then triggers another one and so on (e.g. I may be running a genrule, which requires extraction of some archive etc).
Q: Is there a way to use the information from the exec log or BEP to see which one is the root action for a subset of actions?
I initially thought that the field targetLabel in the execLog was what I was looking for, but upon closer inspection, not every target listed in there is explicitly declared by a human in the bazel build files.
Another intuition I had was that if the set of inputs for a specific action was empty, then that must be the leading action, but also this idea turned out to be not correct.
Use case: for debugging purposes, i.e. when debugging cache misses, it may be the case that a specific action missed, however, it may not be due to the action itself, but because its parent action missed and so on.
Thanks for whomever wants to chip in with their suggestions!
Beta Was this translation helpful? Give feedback.
All reactions