commit | 2f75f30f1ac22542715b34ee142e5371a6a3a423 | [log] [tgz] |
---|---|---|
author | Xùdōng Yáng <wyverald@gmail.com> | Tue Sep 19 18:44:33 2023 -0400 |
committer | GitHub <noreply@github.com> | Wed Sep 20 00:44:33 2023 +0200 |
tree | 59f9c4b33a0dec694ffd8f84010c4ab862f933f7 | |
parent | ec8c12da43e80eaad81bc4b3ba4e173a1e34c9c0 [diff] |
[6.4.0] Add `--consistent_labels` flag to all query commands (#19567) If enabled, labels are emitted as if by the Starlark `str` function applied to a `Label` instance. This is useful for tools that need to match the output of different query commands and/or labels emitted by rules. If not enabled, output formatters are free to emit apparent repository names (relative to the main repository) instead to make the output more readable. This is implemented by replacing all `Label#toString()` calls in query code with an indirection through a `LabelPrinter` object constructed in a central place. There are currently three types of instances: * `canonical` behaves just like `str(Label(...))`; * `apparent` matches the current behavior, which renders main repo labels in repo-relative form and attempts to use the apparent names for external repos if possible; * `legacy` is used in all non-query callsites and uses `Label#toString()`. Fixes #17864 RELNOTES: The new `--consistent_labels` option on `query`, `cquery`, and `aquery` can be used to force consistent label formatting across all output modes that is also compatible with `str(Label(...))` in Starlark. Closes #19508. PiperOrigin-RevId: 566723654 Change-Id: Ifa08a82e281f423faa971c46bf7277cb307698b5 --------- Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
To report a security issue, please email security@bazel.build with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue. Our vulnerability management team will respond within 3 working days of your email. If the issue is confirmed as a vulnerability, we will open a Security Advisory. This project follows a 90 day disclosure timeline.
See CONTRIBUTING.md