Conversation
…ases
The hub repo's generated BUILD.bazel previously emitted only aliases —
one per platform, plus an alias literally named `all` pointing at just
the first platform's toolchain. Downstream projects doing:
register_toolchains("@verus_toolchains//:all")
hit Bazel's ambiguity rule (":all" is both a wildcard and an alias
target) and resolved to the alias, which pointed at a non-toolchain()
target. Result: "No matching toolchains found" on any toolchain
resolution attempt.
Fix: drop the alias-based layout and emit one proper `toolchain()`
wrapper per supported platform, each referencing the underlying
`verus_toolchain_info` provider with the matching
exec_compatible_with / target_compatible_with constraints. Remove the
conflicting alias named `all` so Bazel's package-wildcard
interpretation of `:all` takes over and registers every platform's
toolchain, letting native resolution pick the correct one.
Reproduction (before fix):
cd rivet/verus && bazel test //:rivet_specs_verify
ERROR: While resolving toolchains for target //:rivet_specs_verify:
No matching toolchains found for types
With this change, toolchain resolution succeeds on Linux CI runners
and host Darwin runners without further changes to consumer
MODULE.bazel files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Downstream projects using rules_verus via:
```starlark
register_toolchains("@verus_toolchains//:all")
```
hit Bazel's ambiguity rule — `:all` is both a wildcard and the name of an existing alias rule in the hub repo. Bazel picks the alias interpretation, which points to only the first platform's underlying target (not even a `toolchain()` rule), so no toolchains are registered:
```
WARNING: The target pattern '@verus_toolchains//:all' is ambiguous:
':all' is both a wildcard, and the name of an existing alias rule;
using the latter interpretation
ERROR: While resolving toolchains for target //:rivet_specs_verify:
No matching toolchains found for types
```
This is blocking Verus CI on rivet (https://github.com/pulseengine/rivet/actions/runs/24649838100/job/72070649411).
Fix
Change the hub repo's generated BUILD.bazel from an alias-based layout to one proper `toolchain()` wrapper per supported platform:
With no alias shadowing `:all`, Bazel's wildcard-package interpretation takes over and registers all per-platform `toolchain()` rules at once. Native toolchain resolution then selects the correct one based on the exec platform.
Scope
Test plan
🤖 Generated with Claude Code