Skip to content

Follow missing external alias inputs - #630

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

tamird wants to merge 5 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 named in --fineGrainedHashExternalRepos, changing the input behind @public//:forward → //:bridge → //:second_bridge → @library//:copy changes the built consumer from before to after. The previous graph stopped at an alias already returned by the primary query and missed the consumer.

On Bazel 8+, follow verified native alias bindings and retain dependencies and BUILD files for missing destinations. Literal chains can pass through ordinary aliases already returned by the primary query. Configurable ordinary aliases in the primary graph use the existing inventory of matching external packages already represented by rule rows, and other attributes keep the caller's projection.

Returned regular external sources are hashed by content and recorded for partial reuse, with source overrides preserved. Updated cache and partial recipe identities regenerate older graphs.

Validation: stock Bazel 8.8.2 regressions for products and inactive branches; alias, query failure, and partial rebuild tests; Rust/CLI, Clippy, formatting, and case regeneration checks.

Assisted by Codex.

@tamird
tamird force-pushed the codex/bazel-diff-alias-acquisition-20261105 branch 2 times, most recently from 7ba551f to 9ed4db3 Compare November 7, 2026 04:02
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.
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.
A reached fine alias can point through returned literal aliases to a
missing external target. The scan for missing inputs stopped at the
first returned alias, so changing the external target's input could
change a built consumer without selecting it.

Inspect the returned native scalar bindings in batches and pass only
missing destinations to the existing dependency query. Configurable
ordinary aliases in the primary graph retain the existing package
inventory behavior.

Refresh cache and partial recipe identities so older graphs are
regenerated.

Assisted by Codex.
@tamird
tamird force-pushed the codex/bazel-diff-alias-acquisition-20261105 branch from 56ac285 to 32164c8 Compare November 7, 2026 16:51

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