Skip to content

Track toolchain implementations in query mode - #619

Merged
tinder-maxwellelliott merged 1 commit into
Tinder:masterfrom
tamird:fix/query-toolchain-implementations
Nov 4, 2026
Merged

tinder-maxwellelliott merged 1 commit into
Tinder:masterfrom
tamird:fix/query-toolchain-implementations

Conversation

@tamird

@tamird tamird commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Bazel declares the implementation of a native toolchain rule as a NODEP_LABEL. Ordinary query emits it as a string attribute with nodep=true and omits it from the registration's rule inputs. As a result, changing only the implementation left the registration out of the impacted targets. 1

Track the implementation labels that query reports. The regression changes a toolchain's output and checks that its implementation has target distance 0 and its registration has distance 1. For toolchain = select(...) with multiple possible values, pass --bazelCommandOptions=--noproto:flatten_selects to retain all branches. Bazel's default flattened output omits those scalar values. 2

Invalidate earlier ordinary-query cache entries and regenerate older partial recipes whose inputs omit the edge. This covers registration targets. Identifying which rules resolve those toolchains is a separate query problem.

Prepared by Codex on behalf of Tamir Duberstein.

Bazel omits the implementation of a native toolchain declaration from its ordinary query inputs. Read the implementation label from the toolchain attribute so changing the implementation also impacts its registration. For an unflattened select, include each reported implementation.

Invalidate cached ordinary graphs and regenerate older partial recipes that lack these edges. The regression builds a changed toolchain product and checks the registration distance.
@tinder-maxwellelliott
tinder-maxwellelliott merged commit 2a6d037 into Tinder:master Nov 4, 2026
19 checks passed
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