D2 — a non-dev register_toolchains propagates to every transitive consumer
Dev-dep & toolchains · gates/d2_undeclared_toolchain_leak.rq ↗
Why this is an invariant#
rules_k8s refuses to register at all and defers to —extra_toolchains;
rules_lean scopes its smoke toolchain with dev_dependency = True. Both are
deliberate, and both are documented in prose in their MODULE.bazel. This
makes that reasoning machine-checked.
The predicate is UNDECLARED leakage, not any registration: rules_jena
legitimately registers four Jena toolchains because being a toolchain
implementation is its entire purpose. Providers opt in via
gate:toolchainProviderFor in declarations.ttl, which keeps the exception list
reviewable as data rather than buried in a query.
An exemption comes in two strengths, and the difference matters:
- UNSCOPED —
[] gate:toolchainProviderFor "rules_jena" .exempts every toolchain the module registers. Correct only when providing toolchains is the module’s entire purpose. - SCOPED — the same, plus one gate:providesToolchain per label. Exempts only
those labels; anything else the module registers is still a finding. This
is what lets
rules_lorabe accountable for its three backend toolchains while its accidental@rust_toolchains//:allleak still shows up.
Both keyed on the module NAME, never a version IRI: an exemption says what a module IS, and republishing must not silently re-trip the gate.
Findings#
49 findings. Each row is a counterexample — the columns are the query's own, in the order it selects them.
| module | version | toolchain |
|---|---|---|
botnoc | 0.1.0 | @rust_toolchains//:all |
botnoc | 0.1.0 | @zig_sdk//toolchain:linux_amd64_gnu.2.28 |
botnoc | 0.1.0 | @zig_sdk//toolchain:linux_arm64_gnu.2.28 |
brand | 0.3.1 | @tectonic//:tectonic_toolchain_def |
brando | 0.5.0 | @tectonic//:tectonic_toolchain_def |
fastverk-app | 0.0.2 | @rust_toolchains//:all |
forge | 0.0.6 | @rust_toolchains//:all |
forge | 0.0.6 | @zig_sdk//toolchain:linux_amd64_gnu.2.28 |
forge | 0.0.6 | @zig_sdk//toolchain:linux_arm64_gnu.2.28 |
fvkit | 0.0.9 | @rust_toolchains//:all |
meridian_tui | 0.5.0 | @meridian_uiview_core//rust:prost_toolchain |
meridian_tui | 0.5.0 | @rust_toolchains//:all |
meridian_uiview_core | 0.6.0 | //rust:prost_toolchain |
meridian_uiview_core | 0.6.0 | @rules_rust_wasm_bindgen//:default_wasm_bindgen_toolchain |
meridian_uiview_core | 0.6.0 | @rust_toolchains//:all |
rules_agentic_ide | 0.0.4 | @rules_jena//jena:jena_reasoner_toolchain_def |
rules_agentic_ide | 0.0.4 | @rules_jena//jena:jena_riot_toolchain_def |
rules_agentic_ide | 0.0.4 | @rules_jena//jena:jena_shacl_toolchain_def |
rules_agentic_ide | 0.0.4 | @rules_jena//jena:jena_sparql_toolchain_def |
rules_agentic_ide | 0.0.4 | @rust_toolchains//:all |
rules_cc_cross | 0.1.0 | @arm_gnu_aarch64_none_elf//:all |
rules_cloudformation | 0.10.0 | //cloudformation/aws_cli:default_aws_cli_toolchain |
rules_docker_compose | 0.2.6 | @rust_toolchains//:all |
rules_gitlab | 0.3.4 | //gitlab/glab:default_glab_toolchain |
rules_gitlab | 0.3.4 | @rules_uv//uv:uv_toolchain_def |
rules_graphviz | 0.2.0 | //graphviz:graphviz_toolchain_def |
rules_graphviz | 0.2.0 | @bun//:bun_toolchain_def |
rules_huggingface | 0.0.4 | //huggingface:hf_default_toolchain |
rules_huggingface | 0.0.4 | @rust_toolchains//:all |
rules_jsonschema | 0.4.0 | //go:default_go_codegen_toolchain |
rules_jsonschema | 0.4.0 | //rust:default_rust_codegen_toolchain |
rules_jsonschema | 0.4.0 | //starlark:default_starlark_codegen_toolchain |
rules_jsonschema | 0.4.0 | @rust_toolchains//:all |
rules_lora | 0.1.4 | @rules_lora//lora/backend:local_toolchain |
rules_lora | 0.1.4 | @rules_lora//lora/backend:modal_toolchain |
rules_lora | 0.1.4 | @rules_lora//lora/backend:runpod_toolchain |
rules_lora | 0.1.4 | @rust_toolchains//:all |
rules_openapi | 0.4.0 | //go:default_go_client_codegen_toolchain |
rules_runpod | 0.0.11 | @rust_toolchains//:all |
rules_spec | 0.5.1 | @rules_spec_lake//:lean_toolchain_def |
rules_ssh_tui | 0.0.5 | @rust_toolchains//:all |
rules_uv | 0.7.4 | //uv:uv_toolchain_def |
rules_uv | 0.7.4 | @rust_toolchains//:all |
tracker | 0.0.4 | @rust_toolchains//:all |
tracker | 0.0.4 | @zig_sdk//toolchain:linux_amd64_gnu.2.28 |
tracker | 0.0.4 | @zig_sdk//toolchain:linux_arm64_gnu.2.28 |
vpn | 0.0.1 | @llvm_toolchain//:all |
vpn | 0.0.1 | @rust_toolchains//:all |
wave | 0.0.1 | @rust_toolchains//:all |