Skip to content

Follow missing external alias inputs - #630

Open
tamird wants to merge 4 commits into
Tinder:masterfrom
tamird:codex/bazel-diff-alias-acquisition-20261105
Open

tamird wants to merge 4 commits into
Tinder:masterfrom
tamird:codex/bazel-diff-alias-acquisition-20261105

Conversation

@tamird

@tamird tamird commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

With @public listed in --fineGrainedHashExternalRepos, an ordinary alias can point through an external alias to another library in a package the fine traversal has reached. Editing that library's generated input changed the built consumer from before to after, but the graph omitted the intermediate alias and library and did not select the consumer.

On Bazel 8+, read native actual bindings and ask Bazel for dependencies and BUILD files of missing fine alias destinations. For ordinary aliases, retain named targets and their dependencies from one inventory of matching packages already represented by rule rows. Hash the verified alias bindings, including every select() destination. Other attributes use the caller's projection.

Returned regular external sources are hashed by content and recorded for partial reuse, with source overrides preserved. New cache and partial recipe identities force older graphs to be regenerated.

Validation: stock Bazel 8.8.2 product, alias, query failure, and partial rebuild regressions; Rust/CLI, Clippy, formatting, and case regeneration checks.

Assisted by Codex.

@tamird
tamird force-pushed the codex/bazel-diff-alias-acquisition-20261105 branch from 77cd021 to 547acc0 Compare November 6, 2026 20:18
An ordinary query can return an external alias without returning the
library behind another alias. A source edit can then change the built
consumer without selecting it.

For aliases reached in repositories selected for individual target
hashing, inspect native actual values and ask Bazel for dependencies and
build files of distinct missing destinations. Reuse primary targets and
preserve the caller's attribute projection. Full source hashing with
fine repository options reads returned regular external files.

Keep alias acquisition off before Bazel 8. Report supplemental errors in
strict mode and retain the primary graph under keep-going. Resolve
repository settings read from a file in snapshot identity and use
partial recipe version 5, distinct from version 4 in Tinder#628.

Assisted by Codex.
A generated BUILD can declare many aliases. Hashing it as an input of
every forwarding alias made a version change to one sibling select
unchanged users of another. The ordinary input list also loses which
destination belongs to each condition when actual is projected out.

Read native aliases' evaluated actual on both sides of the primary
query boundary and use the existing attribute hasher for that binding.
Keep BUILD and loaded Starlark inputs on the acquired terminal rules.

Test a sibling edit and a selector swap with identical input labels
both when destinations require acquisition and when they are already
present. Renew the compatible snapshot and partial recipes.
The collector for fine repositories reads returned external files for
full hashing, but partial generation skips that path. A fine alias can
reach a source outside the named repositories while the partial recipe
omits its digest. The existing product and graph reuse checks did not
assert that this source was recorded.

Allow partial generation to read returned regular sources through
their canonical repository paths. Keep the previous resolver when the
Git content map supplies either repository spelling, and preserve full
source overrides. Reuse the existing recorder and advance the partial
recipe version.

Extend the regression for fine aliases to require both the saved
source digest and the reported source hash to change after the real
file edit, alongside the existing product and graph reuse checks.

Assisted by Codex.
@tamird
tamird force-pushed the codex/bazel-diff-alias-acquisition-20261105 branch from 7ba551f to 9ed4db3 Compare November 7, 2026 04:02
A fine alias can expose part of an external package while an ordinary
alias names a different target there. The previous graph could omit
that target and miss a consumer whose built output changed.

Reuse the existing input walk to find those aliases. Verify native
actual bindings, inventory matching packages where the fine traversal
returned rules, and retain the returned dependencies of the named
targets. The existing alias rehash preserves their complete bindings.

Invalidate prior alias cache entries and partial recipes.

Assisted by Codex.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant