Detect extension staleness due root module name/version change
Fixes #22121
@bazel-io fork 7.2.0
Alternative idea: at https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java;drc=6f48f1c2b3bb73768b9ff15ce6698e21eddc503a;l=224 , hash the entire usagesValue instead. (or at least, also hash the abridged modules.) That seems to be a less intrusive and more foolproof change: all information that the extension has access to comes from the usagesValue anyway.
The whole value would be too much as it contains repo mappings, but hashing in the abridged modules is a great idea.
I implemented the new approach, PTAL.
@jin The only failing test is for Skyfocus. It looks like it can result in certain Skyframe nodes missing after the build that are contained in the transitive closure of RepositoryMappingValue.key(RepositoryName.MAIN), which is requested by every build. Do I need to make any changes to the working set logic to keep this value in the graph?