bazelbuild/bazel

aquery: get actions used in clean build

Open

#14,156 opened on 2021年10月23日

GitHub で見る
 (0 comments) (1 reaction) (0 assignees)Java (4,465 forks)batch import
P3help wantedteam-Performancetype: feature request

Repository metrics

Stars
 (25,384 stars)
PR merge metrics
 (平均マージ 22d 20h) (30d で 77 merged PRs)

説明

Hey awesome Bazel team,

I'd love a way to aquery for precisely the actions used in a building a target.

In deeper detail: When introspecting the build of a given target, you'd like be able to aquery the actions that would be run in a clean build of that target. [More precisely, you'd like to be able to easily aquery the transitive closure of actions involved in building the default outputs of a target.]

Currently, aquery provides something that seems similar, but is actually a problematic superset: You can ask for all the actions of all the dependencies of a target. This is a superset of the above that includes actions that are unused and unneeded--and sometimes unconfigured or otherwise malformed and problematic.

Background goal: I'm building a tool that uses aquery to build clangd-powered autocomplete for VSCode and some other editors. This involves extracting the compile commands used in a build--and it's awesome to be able to query actions with aquery. Other Bazel users keep asking me to open source the tool, and I noticed this quirk in behavior while trying to polish up some edge cases.

Thanks so much, Chris (ex-Googler)

P.S. I'd emailed with some of the aquery folks about this previously (@joeleba)--I'm posting it here to have a place to publicly discuss/track for anyone reading the source of the tool when I release it.

コントリビューターガイド