[10.0.0] Make `equals` of Skyframe values cover the data consumers read (#31964) (#32305)

Fixes `equals` of several Skyframe values to also compare data that
consumers read:

* `InterimModule`: the order of `bazel_dep`s, which determines the order
of `module_ctx.modules` and of toolchain and execution platform
registration.
* `AttributeValues`: the order of dict entries and set elements and the
distinction between ints and floats, which module extensions and repo
rules can observe (e.g. `remote_patches` order, tag dict attributes,
`1.0` passed to an `attr.int()` tag attribute).
* `--registry` and `--module_mirrors`: now passed on as ordered lists
since the first registry that contains a module wins and mirrors are
tried in order.
* `BuildConfigurationValue`: the CPU of the target platform, which
`$(TARGET_CPU)` reads.
* `PlatformMappingValue`: the order of `flags:` entries since the first
matching entry wins.
* `TargetPatternPhaseValue`: the labels used to find `PROJECT.scl`
files. Its value is currently never change-pruned since it is stored
together with events.

Skyframe keeps the old value object when a recomputed value is equal to
it, so until the server restarts, consumers keep seeing data that
`equals` ignores. In all but the last case above, this made incremental
builds behave differently from clean ones, e.g. swapping two `bazel_dep`
lines or two `--registry` flags had no effect until `bazel shutdown`.

Same class of bug as #31952.

No

RELNOTES: None

Closes #31964


COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/bazel/pull/31964
from fmeum:change-pruning-order-fixes
1d93e2f1adb1be5d11dbfe0ef9cde24fda8a6688 PiperOrigin-RevId: 1009547528
Change-Id: I91a801061a3be7427277283548767a5d1da6143a

<!--
Thank you for contributing to Bazel!
Please read the contribution guidelines: https://bazel.build/contribute
and guidelines for AI-assisted contributions:
https://bazel.build/contribute/ai-assisted-contributions
-->

### Description
<!--
Please provide a brief summary of the changes in this PR.
-->

### Motivation
<!--
Why is this change important? Does it fix a specific bug or add a new
feature?
If this PR fixes an existing issue, please link it here (e.g. "Fixes
#1234").
-->

### Build API Changes
<!--
Does this PR affect the Build API? (e.g. Starlark API, providers,
command-line flags, native rules)
If yes, please answer the following:
1. Has this been discussed in a design doc or issue? (Please link it)
2. Is the change backward compatible?
3. If it's a breaking change, what is the migration plan?
-->

No

### Checklist

- [ ] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

### Release Notes

<!--
If this is a new feature, please add 'RELNOTES[NEW]: <description>'
here.
If this is a breaking change, please add 'RELNOTES[INC]: <reason>' here.
If this change should be mentioned in release notes, please add
'RELNOTES: <reason>' here.
-->

RELNOTES: None

Commit
https://github.com/bazelbuild/bazel/commit/c9779964bddd85b6173b508ed963cc1ae0a07413

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
19 files changed
tree: cbc2010295f6451648bf3e9d96536f1297e9f240
  1. .bazelci/
  2. .devcontainer/
  3. .gemini/
  4. .github/
  5. docs/
  6. examples/
  7. scripts/
  8. src/
  9. third_party/
  10. tools/
  11. .bazelrc
  12. .bazelversion
  13. .gitattributes
  14. .gitignore
  15. AGENTS.md
  16. AUTHORS
  17. bazel_downloader.cfg
  18. BUILD
  19. CHANGELOG.md
  20. CODE_OF_CONDUCT.md
  21. CODEOWNERS
  22. combine_distfiles.py
  23. combine_distfiles_to_tar.sh
  24. compile.sh
  25. CONTRIBUTING.md
  26. CONTRIBUTORS
  27. distdir.bzl
  28. extensions.bzl
  29. LICENSE
  30. maven_install.json
  31. MODULE.bazel
  32. MODULE.bazel.lock
  33. oneversion_allowlist.csv
  34. oneversion_allowlist_for_tests.csv
  35. pyproject.toml
  36. README.md
  37. repositories.bzl
  38. requirements.txt
  39. SECURITY.md
  40. verify_module_bazel_lock.sh
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