Bazel | beLow - Technical documentation
This method should also be used on Linux, in case your Bazel setup involves some server-side build cache.
Using beLow with Bazel requires an intermediate representation of the compilation, called Bazel acyclic query graph, which is a specific JSON representation of a Bazel build. beLow transforms this representation into a compilation database.
To generate the requested file, use the aquery Bazel subcommand.
If your usual build command is:
bazel build //...Generating the JSON graph to standard output is done by running:
bazel aquery //...This output must be written to a file called bazel_action_graph.json during project configuration for beLow to understand the context. For example:
bazel aquery //... > bazel_action_graph.jsonNote: On Windows, the encoding of the output graph could be incompatible with beLow because the output format depends on the system language. To force the output encoding using PowerShell:
bazel aquery //... | Out-File -Encoding ASCII -FilePath ./bazel_action_graph.jsonIf your Bazel setup uses a server-side build cache, make sure to run the aquery generation step as part of project configuration so beLow has the full context.
Configuration for beLow
Configure
Script content:
bazel aquery //... > bazel_action_graph.jsonScript execution path: In the target directory
Shell: Bash
Direct link to tab: https://docs.wedolow.com/below-technical-documentation/compatibility-guide/bazel#tab-linux
Script content:
bazel aquery //... | Out-File -Encoding ASCII -FilePath ./bazel_action_graph.jsonScript execution path: In the target directory
Shell: Pwsh
Direct link to tab: https://docs.wedolow.com/below-technical-documentation/compatibility-guide/bazel#tab-windows
Clean
Script content:
bazel clean //...Script execution path: In the target directory
Shell: Bash
Direct link to tab: https://docs.wedolow.com/below-technical-documentation/compatibility-guide/bazel#tab-linux-1
Script content:
bazel clean //...Script execution path: In the target directory
Shell: Pwsh
Direct link to tab: https://docs.wedolow.com/below-technical-documentation/compatibility-guide/bazel#tab-windows-1
Build
Script content:
bazel build //...Script execution path: In the target directory
Shell: Bash
Direct link to tab: https://docs.wedolow.com/below-technical-documentation/compatibility-guide/bazel#tab-linux-2
Script content:
bazel build //...Script execution path: In the target directory
Shell: Pwsh
Direct link to tab: https://docs.wedolow.com/below-technical-documentation/compatibility-guide/bazel#tab-windows-2
