Repository navigation
Follow verified external filegroup inputs - #647
Merged
tinder-maxwellelliott merged 3 commits intoNov 10, 2026
Merged
tinder-maxwellelliott merged 3 commits into
tinder-maxwellelliott merged 3 commits into
Conversation
Ordinary queries can name an external filegroup without returning its body. The parent then inherits the repository's generated siblings, so an unrelated sibling edit can change its hash. Read missing native filegroups and sources through exact labels. Narrow a genrule's forwarded operand only after its normal definition and input list match a strict native record with an empty toolchains attribute and every direct child has a verified source or filegroup path. Preserve the fallback for opaque or incomplete inputs. Extend internal repository definition paths through positively mapped module dependencies at their original //external hops. Keep the original aggregate nodes and their paths for unqualified operands. Retain the typed BUILD package marker and recover omitted BUILD.bazel load names with one bounded buildfiles query. Only returned .bzl packages seed the existing checks. Invalidate cached graphs with fine repository inputs and older partial recipes.
30c96aa compares a rule digest under the caller's projection with a full declaration. Bazel's synthetic attribute hash depends on which attribute encodings are emitted [1], so the digests differ under a filtered projection. The repository fallback then selects an unrelated reader of a copied file. When the caller explicitly requests the synthetic hash, re-read the candidate parent with the caller's projection in the existing supplemental query. Accept that digest only when Bazel returns its synthetic attribute, keeping the value opaque. Preserve the strict class, input, and source checks, and retain the fallback when the evidence is missing or malformed. Cover projected attributes and an opaque tool omitted by --notool_deps. Advance the cache version for fine inputs because the flat graph changes. [1]: https://github.com/bazelbuild/bazel/blob/8.8.2/src/main/java/com/google/devtools/build/lib/query2/query/output/SyntheticAttributeHashCalculator.java
tamird
force-pushed
the
codex/bazel-diff-observed-filegroup-inputs-20261110
branch
from
November 10, 2026 14:24
5707d4e to
5f91299
Compare
A buildfiles query can return a synthetic BUILD row for a loaded package at the same label as its evaluated BUILD. When an external alias brings in a rule from that package, accepting the synthetic row makes the BUILD hash insensitive to its transitive load labels. Query the ambiguous BUILD labels for acquired rule packages together. Restore loads only from an evaluated, error-free SourceFile and advance the fine-input cache and partial recipe versions. Rename a transitive Starlark load in the stock SDK fixture at fixed BUILD bytes. The old flat SourceFile hashes were identical across the edit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changing a compiler repository can select a genrule that only reads an unchanged copied file through an external filegroup. With
--fineGrainedHashExternalRepos, follow verified filegroup and source inputs in the normal flat graph so that genrule stays out of the impact set.Replace that operand's repository fallback only after strict queries match native filegroup and genrule definitions, confirm an empty
toolchainsattribute, and account for every direct child with verified source or filegroup inputs. Projected queries require matching synthetic attribute evidence from a fresh row under the same projection. Opaque or omitted inputs keep the #529 fallback, and compiler consumers without complete provider evidence can still be overselected. Repository definition nodes from #646 preserve target and package distances.When an acquired rule’s package BUILD appears as a synthetic loading row, re-query the reached BUILD labels together and recover the evaluated list of loaded Starlark files. The resulting source hash tracks transitive load labels even when the BUILD bytes stay fixed.
Maintained product checks on stock Bazel 8.8.2:
//tests:e2e_test_external_returned_external_source_reaches_consumer: copied source, unrelated compiler edit, projected attributes, and an opaque tool hidden by--notool_deps.//tests:e2e_test_external_fine_alias_to_a_source_tracks_its_contents_and_visibility: source and visibility changes plus repository distances.//tests:e2e_test_regressions_extension_repo_patch_edit_impacts_toolchain_user: an SDK patch reaches its user, and renaming a transitive Starlark load changes the acquired SDK BUILD hash at fixed BUILD bytes.Also validated with the instrumented Rust/CLI unit suite, rustfmt, and Clippy.
Assisted by OpenAI Codex.