Skip to content

The "toolchains from rules_rust" example in the readme doesn't work #84

@ammar-elsabe

Description

@ammar-elsabe

Hi, I dont know if I am being stupid or if this is a bug but when I tried this

bazel_dep(name = "rules_rs", version = "0.0.49")

rules_rust = use_extension("@rules_rs//rs/experimental:rules_rust.bzl", "rules_rust")
use_repo(rules_rust, "rules_rust")

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust") # error is referring to this line
rust.toolchain(
    edition = "2024",
    versions = ["1.92.0"],
)

use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")

as specified in the README, bazel complains with

$ bazel build //...
ERROR: Error computing the main repository mapping: invalid label for module extension found at <redacted>/MODULE.bazel:22:21: no repo visible as '@rules_rust' here
Computing main repo mapping:
$ bazel version
Bazelisk version: v1.27.0
Build label: 9.0.1
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Tue Mar 10 16:50:28 2026 (1773161428)
Build timestamp: 1773161428
Build timestamp as int: 1773161428

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions