bazelbuild / bazelbuild/rules_rust

rules_rust is failing to find _cc_toolchain in WORSPACE setup after updating to 0.57.1

Open
#3,242 4 comments 0 reactions 0 assignees View on GitHub
bug needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

I am using WORKSPACE based setup with Bazel 7.4

bazel build is able to pick the _cc_toolchain on version 0.56, but failing with the following compile error after updating to 0.57.1 (redacted):

```
...
ERROR: .../external/rust_linux_x86_64__x86_64-unknown-linux-gnu__stable_tools/BUILD.bazel:96:15: in rust_toolchain rule @@rust_linux_x86_64__x86_64-unknown-linux-gnu__stable_tools//:rust_toolchain:
Traceback (most recent call last):
File ".../external/rules_rust/rust/toolchain.bzl", line 670, column 72, in _rust_toolchain_impl
libstd_and_allocator_ccinfo = _make_libstd_and_allocator_ccinfo(ctx, rust_std, ctx.attr.allocator_library, "std"),
File ".../external/rules_rust/rust/toolchain.bzl", line 159, column 60, in _make_libstd_and_allocator_ccinfo
cc_toolchain, feature_configuration = find_cc_toolchain(ctx)
File ".../external/rules_rust/rust/private/utils.bzl", line 55, column 43, in find_cc_toolchain
cc_toolchain = find_rules_cc_toolchain(ctx)
File ".../external/bazel_tools/tools/cpp/toolchain_utils.bzl", line 63, column 9, in find_cpp_toolchain
fail("In order to use find_cpp_toolchain, you must define the '_cc_toolchain' attribute on your rule or aspect.")
Error in fail: In order to use find_cpp_toolchain, you must define the '_cc_toolchain' attribute on your rule or aspect.
...
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.