Skip to content

[9.3.0] Register a FileValue dep on bzlCompileCache hits in BzlLoadFunction (… - #31137

Merged
iancha1992 merged 1 commit into
bazelbuild:release-9.3.0from
iancha1992:cp2fccd6a88b714dfbe9bfd340baf29182e7c829ab
Sep 15, 2026
Merged

iancha1992 merged 1 commit into
bazelbuild:release-9.3.0from
iancha1992:cp2fccd6a88b714dfbe9bfd340baf29182e7c829ab

Conversation

@iancha1992

Copy link
Copy Markdown
Member

#30902)

The KeyForBuild and KeyForBzlmod variants of a BzlLoadValue key for the same .bzl file share a single BzlCompileValue.Key, and thus a single entry in the bzlCompileCache used when BzlCompileFunction is inlined. When a BzlLoadValue node got a cache hit for an entry that was computed on behalf of a node of the other key variant, it never requested the FileValue for the .bzl file, so it was missing the Skyframe edge that would invalidate it when the file changes and kept serving stale file contents on subsequent builds.

Fix this by (re-)requesting the FileValue for the .bzl file on a cache hit.

Fixes #30900

No

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

RELNOTES: None

Closes #30902

COPYBARA_INTEGRATE_REVIEW=#30902 from fmeum:claude/bazel-issue-30900-gtza50 bb23137 PiperOrigin-RevId: 981304041
Change-Id: I16c31a54ad4996d2f94f7061b1b72bb0a6eb9db1

Description

Motivation

Build API Changes

No

Checklist

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

Release Notes

RELNOTES: None

Commit 2fccd6a

…azelbuild#30902)

The KeyForBuild and KeyForBzlmod variants of a BzlLoadValue key for the same .bzl file share a single BzlCompileValue.Key, and thus a single entry in the bzlCompileCache used when BzlCompileFunction is inlined. When a BzlLoadValue node got a cache hit for an entry that was computed on behalf of a node of the other key variant, it never requested the FileValue for the .bzl file, so it was missing the Skyframe edge that would invalidate it when the file changes and kept serving stale file contents on subsequent builds.

Fix this by (re-)requesting the FileValue for the .bzl file on a cache hit.

Fixes bazelbuild#30900

No

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

RELNOTES: None

Closes bazelbuild#30902

COPYBARA_INTEGRATE_REVIEW=bazelbuild#30902 from fmeum:claude/bazel-issue-30900-gtza50 bb23137
PiperOrigin-RevId: 981304041
Change-Id: I16c31a54ad4996d2f94f7061b1b72bb0a6eb9db1
@iancha1992 iancha1992 added team-Core Skyframe, bazel query, BEP, options parsing, bazelrc awaiting-review PR is awaiting review from an assigned reviewer labels Sep 14, 2026
@iancha1992
iancha1992 requested a review from a team as a code owner September 14, 2026 20:35
@iancha1992
iancha1992 added this pull request to the merge queue Sep 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Sep 15, 2026
@iancha1992
iancha1992 added this pull request to the merge queue Sep 15, 2026
Merged via the queue into bazelbuild:release-9.3.0 with commit bf9017e Sep 15, 2026
42 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Core Skyframe, bazel query, BEP, options parsing, bazelrc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants