Skip to content

Hash external source files returned by cquery - #590

Merged
tinder-maxwellelliott merged 1 commit into
Tinder:masterfrom
tamird:fix/cquery-returned-external-source
Oct 30, 2026
Merged

tinder-maxwellelliott merged 1 commit into
Tinder:masterfrom
tamird:fix/cquery-returned-external-source

Conversation

@tamird

@tamird tamird commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

A repository rule in the regression symlinks a workspace file into its generated repository. Changing that file changed the consuming genrule’s output from before to after. With --useCquery, Bazel returned the mirror as a source input, but bazel-diff assigned it an empty digest because the repository wasn’t listed for fine-grained hashing. get-impacted-targets missed the genrule.

For a full configured query, hash a returned regular file at its exact canonical repository path. This lets the existing dependency carry its contents into the consumer’s hash. Missing paths retain the existing repository handling. Unexpected errors reading or inspecting a concrete path report its source label and path.

Prepared with Codex.

A repository rule can symlink a workspace file into its generated
repository. Editing the workspace file changed the consuming action's
output, but generate-hashes gave the returned external source an empty
digest when its repository was not listed for fine-grained hashing.
get-impacted-targets then missed the consumer.

When cquery returns a canonical source label, hash the regular file at
that exact repository path. Preserve existing resolution for missing
files and for partial or explicitly supplied inputs.
@tinder-maxwellelliott
tinder-maxwellelliott merged commit 240bb4b into Tinder:master Oct 30, 2026
21 checks passed
@tamird
tamird deleted the fix/cquery-returned-external-source branch October 30, 2026 19:02
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.

2 participants