Change-prune repo definitions (#32793) ### Description Compare `RepoRule`s by identity so that `RepoDefinitionValue` no longer has to be a `NotComparableSkyValue`. A repo rule's implementation function may use the repo mapping of the .bzl file that defines it, which doesn't affect the function's equality since `StarlarkFunction`s from two evaluations of the same .bzl file compare equal. Identity is sound since evaluating the .bzl file again, for example after its repo mapping changed, yields a new `RepoRule` instance. ### Motivation Previously, any change to the root module or the dependency graph, such as editing a module extension tag or a repo rule's attributes in `MODULE.bazel`, reran `RepositoryFetchFunction` for every repo and thus refetched every local repo. Now only local repos whose definitions changed are refetched. Changes to the main repo mapping, such as adding a `use_repo`, still refetch local repos since fetching depends on the full main repo mapping. ### Build API Changes No ### Release Notes RELNOTES: None Closes #32793 COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/bazel/pull/32793 from fmeum:repo-rule-identity b83945a844353d5c5278b44cc3fe70d6c33c61f4 PiperOrigin-RevId: 1025433397 Change-Id: Ief3052f5cf9c7ee2e64effed53a743096c26275a
{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.
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