tomato·bazeldocs v0 · latest

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_lora be accountable for its three backend toolchains while its accidental @rust_toolchains//:all leak 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.

moduleversiontoolchain
botnoc0.1.0@rust_toolchains//:all
botnoc0.1.0@zig_sdk//toolchain:linux_amd64_gnu.2.28
botnoc0.1.0@zig_sdk//toolchain:linux_arm64_gnu.2.28
brand0.3.1@tectonic//:tectonic_toolchain_def
brando0.5.0@tectonic//:tectonic_toolchain_def
fastverk-app0.0.2@rust_toolchains//:all
forge0.0.6@rust_toolchains//:all
forge0.0.6@zig_sdk//toolchain:linux_amd64_gnu.2.28
forge0.0.6@zig_sdk//toolchain:linux_arm64_gnu.2.28
fvkit0.0.9@rust_toolchains//:all
meridian_tui0.5.0@meridian_uiview_core//rust:prost_toolchain
meridian_tui0.5.0@rust_toolchains//:all
meridian_uiview_core0.6.0//rust:prost_toolchain
meridian_uiview_core0.6.0@rules_rust_wasm_bindgen//:default_wasm_bindgen_toolchain
meridian_uiview_core0.6.0@rust_toolchains//:all
rules_agentic_ide0.0.4@rules_jena//jena:jena_reasoner_toolchain_def
rules_agentic_ide0.0.4@rules_jena//jena:jena_riot_toolchain_def
rules_agentic_ide0.0.4@rules_jena//jena:jena_shacl_toolchain_def
rules_agentic_ide0.0.4@rules_jena//jena:jena_sparql_toolchain_def
rules_agentic_ide0.0.4@rust_toolchains//:all
rules_cc_cross0.1.0@arm_gnu_aarch64_none_elf//:all
rules_cloudformation0.10.0//cloudformation/aws_cli:default_aws_cli_toolchain
rules_docker_compose0.2.6@rust_toolchains//:all
rules_gitlab0.3.4//gitlab/glab:default_glab_toolchain
rules_gitlab0.3.4@rules_uv//uv:uv_toolchain_def
rules_graphviz0.2.0//graphviz:graphviz_toolchain_def
rules_graphviz0.2.0@bun//:bun_toolchain_def
rules_huggingface0.0.4//huggingface:hf_default_toolchain
rules_huggingface0.0.4@rust_toolchains//:all
rules_jsonschema0.4.0//go:default_go_codegen_toolchain
rules_jsonschema0.4.0//rust:default_rust_codegen_toolchain
rules_jsonschema0.4.0//starlark:default_starlark_codegen_toolchain
rules_jsonschema0.4.0@rust_toolchains//:all
rules_lora0.1.4@rules_lora//lora/backend:local_toolchain
rules_lora0.1.4@rules_lora//lora/backend:modal_toolchain
rules_lora0.1.4@rules_lora//lora/backend:runpod_toolchain
rules_lora0.1.4@rust_toolchains//:all
rules_openapi0.4.0//go:default_go_client_codegen_toolchain
rules_runpod0.0.11@rust_toolchains//:all
rules_spec0.5.1@rules_spec_lake//:lean_toolchain_def
rules_ssh_tui0.0.5@rust_toolchains//:all
rules_uv0.7.4//uv:uv_toolchain_def
rules_uv0.7.4@rust_toolchains//:all
tracker0.0.4@rust_toolchains//:all
tracker0.0.4@zig_sdk//toolchain:linux_amd64_gnu.2.28
tracker0.0.4@zig_sdk//toolchain:linux_arm64_gnu.2.28
vpn0.0.1@llvm_toolchain//:all
vpn0.0.1@rust_toolchains//:all
wave0.0.1@rust_toolchains//:all