Don't store `WARNING` events in Skyframe.

This means that warnings will no longer be replayed on incremental builds. A similar change was made in https://github.com/bazelbuild/bazel/commit/6e945e8ab422ca0a195d09899cce61ba6c0cfa59 for `DEBUG` events (Starlark print statements).

This is an intentional behavior change made after careful consideration and collaboration. There is a significant memory cost to store events: in addition to retaining the events themselves, each node transitively depending on an event-emitting node must have its `SkyValue` wrapped in `ValueWithMetadata`. This means that adding a single deprecation warning to a low-level target can have a surprisingly enormous memory cost.

Moreover, the use of `--auto_output_filter=subpackages` means that there is a high probability that most warnings will never even be displayed to the user even if stored and replayed.

Stored events are naturally deduplicated because they are stored in a `NestedSet`. To maintain uniqueness, additionally deduplicate warnings. Duplicate warnings may occur if a target is analyzed in multiple configurations, as shown in the test case added to `MiscAnalysisTest`.

RELNOTES: Warnings (most notably those associated with the `deprecation` rule attribute) are no longer replayed on subsequent invocations unless the target in question is re-analyzed. Warnings are purely informational, so this change has no bearing on the correctness of the build. Downstream tests that break due to this change should update their expectations.
PiperOrigin-RevId: 521879494
Change-Id: Ic4e0a68b965ed092b234fe746eeb6ea0b5562f93
26 files changed
tree: 1cea78c338e647f3e80868f2a95893f2a0b989e7
  1. .bazelci/
  2. .github/
  3. examples/
  4. scripts/
  5. site/
  6. src/
  7. third_party/
  8. tools/
  9. .bazelrc
  10. .bazelversion
  11. .gitattributes
  12. .gitignore
  13. AUTHORS
  14. BUILD
  15. CHANGELOG.md
  16. CODE_OF_CONDUCT.md
  17. CODEOWNERS
  18. combine_distfiles.py
  19. combine_distfiles_to_tar.sh
  20. compile.sh
  21. CONTRIBUTING.md
  22. CONTRIBUTORS
  23. distdir.bzl
  24. distdir_deps.bzl
  25. LICENSE
  26. maven_install.json
  27. MODULE.bazel
  28. README.md
  29. SECURITY.md
  30. WORKSPACE
  31. WORKSPACE.bzlmod
README.md

Bazel

{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.

Getting Started

Documentation

Reporting a Vulnerability

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.

Contributing to Bazel

See CONTRIBUTING.md

Build status