Skip to content

Error (rule 'rust_library') doesn't contain declared provider 'CcInfo' for cargo raze deps #368

Closed
@timothyklim

Description

@timothyklim

Hello!
I have an issue in my rust library as JNI after upgrading rules_rust to this commit #361:

load("@//:config.bzl", "rustc_flags")
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library")

rust_library(
    name = "somelib",
    srcs = ["src/lib.rs"],
    crate_root = "src/lib.rs",
    crate_type = "cdylib",
    rustc_flags = rustc_flags,
    deps = [
        "//cargo:jni",
    ],
    visibility = ["//visibility:public"],
)

bazel build:

Traceback (most recent call last):
        File "/home/xxx/Projects/testapp/BUILD.bazel", line 4
                rust_binary(name = 'joiner.so')
        File "/home/xxx/.cache/bazel/_bazel_johndoe/96364899299eda1f2874771f867b1be1/external/io_bazel_rules_rust/rust/private/rust.bzl", line 169, in _rust_binary_impl
                rustc_compile_action(ctx = ctx, <2 more arguments>)
        File "/home/xxx/.cache/bazel/_bazel_johndoe/96364899299eda1f2874771f867b1be1/external/io_bazel_rules_rust/rust/private/rustc.bzl", line 508, in rustc_compile_action
                establish_cc_info(ctx, <4 more arguments>)
        File "/home/xxx/.cache/bazel/_bazel_johndoe/96364899299eda1f2874771f867b1be1/external/io_bazel_rules_rust/rust/private/rustc.bzl", line 551, in establish_cc_info
                dep[CcInfo]
<target //cargo/vendor/jni-0.17.0:jni> (rule 'rust_library') doesn't contain declared provider 'CcInfo'

Dependencies has been generated by cargo-raze v0.3.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions