Skip to content

feat(hash,serve): port graph-hashing and cache fixes inspired by uber… - #520

Merged
tinder-maxwellelliott merged 2 commits into
Tinder:masterfrom
maxwellE:claude/charming-dijkstra-lhznao
Oct 15, 2026
Merged

tinder-maxwellelliott merged 2 commits into
Tinder:masterfrom
maxwellE:claude/charming-dijkstra-lhznao

Conversation

@tinder-maxwellelliott

Copy link
Copy Markdown
Collaborator

…/tango

Hashing:

  • A source label that names a directory now hashes the whole tree (names, kinds, contents, exec bits, symlink targets). Previously a directory was hashed as a missing file, so edits inside it never impacted anything.
  • Repository rules (//external:*) pinned by sha256 or integrity are hashed without url/urls: a mirror or registry move cannot change what they fetch.
  • The main-repository files a repository rule's attributes name (patches, build files, lock files) are hashed by content into the repository's definition, so a changed patch is a changed repository.
  • Dependency cycles in the query graph no longer fail hashing. The back edge is hashed from the entered target's own definition and targets are visited in label order, so the digest is deterministic regardless of query output order. A one-line warning names each cycle.

serve:

  • Cache entries are keyed by the commit's tree hash instead of its SHA, so a rebase, an amended message, or a merge commit that changes no file reuses the entry.
  • Full-content hashes seed source hashes from git ls-tree blob ids instead of reading every tracked file. The scoped modifiedFilepaths path keeps its disk-read semantics, and the configuration fingerprint carries a token so entries from builds without this seeding are never mixed in.

…/tango

Hashing:
- A source label that names a directory now hashes the whole tree (names,
  kinds, contents, exec bits, symlink targets). Previously a directory was
  hashed as a missing file, so edits inside it never impacted anything.
- Repository rules (//external:*) pinned by sha256 or integrity are hashed
  without url/urls: a mirror or registry move cannot change what they fetch.
- The main-repository files a repository rule's attributes name (patches,
  build files, lock files) are hashed by content into the repository's
  definition, so a changed patch is a changed repository.
- Dependency cycles in the query graph no longer fail hashing. The back edge
  is hashed from the entered target's own definition and targets are visited
  in label order, so the digest is deterministic regardless of query output
  order. A one-line warning names each cycle.

serve:
- Cache entries are keyed by the commit's tree hash instead of its SHA, so a
  rebase, an amended message, or a merge commit that changes no file reuses
  the entry.
- Full-content hashes seed source hashes from `git ls-tree` blob ids instead
  of reading every tracked file. The scoped modifiedFilepaths path keeps its
  disk-read semantics, and the configuration fingerprint carries a token so
  entries from builds without this seeding are never mixed in.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MhitctFYvdY81RzRSxpqgN
@tinder-maxwellelliott
tinder-maxwellelliott merged commit 3197ba1 into Tinder:master Oct 15, 2026
21 checks passed
@BarrettStephen

Copy link
Copy Markdown

Have you taken a look at Tango's graph caching and diffing feature to skip calling bazel query?

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.

3 participants