Skip to content

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

@dunnock

Description

@dunnock

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.
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triageThe ticket needs maintainer attention.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions