bazelbuild / bazelbuild/rules_rust

Add missing `rust_toolchain` configuration flags to `rust.toolchain` tag class

Open
#2,611 4 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

Hi,

I'm very new to the field, so please let me know if the information I communicate here is useful enough for debugging.

I have the following dependency in `MODULE.bazel`
```starlark
bazel_dep(name = "rules_rust", version = "0.41.1")
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2024",
versions = ["1.77.2"],
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
```

When running a simple `blaze test` command, I get the following error (I've omitted the more verbose parts):
```
ERROR: .../external/rules_rust~/util/process_wrapper/BUILD.bazel:31:36: Compiling Rust (without process_wrapper) bin process_wrapper (6 files) [for tool] failed: (Exit 1): sandbox-exec failed: error executing Rustc command
...
error: linking with `external/zig_sdk/tools/aarch64-macos-none/c++` failed: exit status: 1
|
= note: env -u ...
= note: error: unable to find dynamic system library 'resolv' using strategy 'paths_first'. searched paths: ...
```

Does anybody know what's happening here, and how to fix this please?

Contributor guide

Open the contributing guide

Research direction

The report uses MODULE.bazel and @rules_rust//rust:extensions.bzl, with the failure observed while building util/process_wrapper/BUILD.bazel. Read the rust.toolchain tag definition and reproduce the reported blaze test command, then determine which rust_toolchain flags are missing from the interface. Done means the required flags are supported and the configuration is covered by relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.