bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Detect extension staleness due root module name/version change

Open fmeum opened this issue 1 year ago • 5 comments

Fixes #22121

fmeum avatar Apr 25 '24 14:04 fmeum

@bazel-io fork 7.2.0

fmeum avatar Apr 25 '24 14:04 fmeum

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.

Wyverald avatar Apr 25 '24 14:04 Wyverald

The whole value would be too much as it contains repo mappings, but hashing in the abridged modules is a great idea.

fmeum avatar Apr 25 '24 15:04 fmeum

I implemented the new approach, PTAL.

fmeum avatar Apr 26 '24 12:04 fmeum

@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?

fmeum avatar Apr 26 '24 16:04 fmeum