bazelbuild/rules_rust

custom proc macro crate not found in a cargo workspace setup

firekind opened this issue · 3 comments

In a cargo setup, when a proc macro crate is present in a cargo workspace, and one of the crates in the workspace depends on the proc macro crate, dependencies fail to resolve with the following error:

Error in fail: /home/developer/.cache/bazel/_bazel_developer/2927fffaf2126be7f97bf2508c6daa6e/modextwd/rules_rust~~crate/cargo-bazel splice --output-dir /home/developer/.cache/bazel/_bazel_developer/2927fffaf2126be7f97bf2508c6daa6e/modextwd/rules_rust~~crate/crates/splicing-output --config /home/developer/.cache/bazel/_bazel_developer/2927fffaf2126be7f97bf2508c6daa6e/modextwd/rules_rust~~crate/crates/config.json --splicing-manifest /home/developer/.cache/bazel/_bazel_developer/2927fffaf2126be7f97bf2508c6daa6e/modextwd/rules_rust~~crate/crates/splicing_manifest.json --cargo-lockfile /workspace/rust/Cargo.lock --cargo /home/developer/.cache/bazel/_bazel_developer/2927fffaf2126be7f97bf2508c6daa6e/external/rules_rust~~rust_host_tools~rust_host_tools/bin/cargo --rustc /home/developer/.cache/bazel/_bazel_developer/2927fffaf2126be7f97bf2508c6daa6e/external/rules_rust~~rust_host_tools~rust_host_tools/bin/rustc returned with exit code 1:

    Blocking waiting for file lock on package cache
    Updating crates.io index
error: no matching package named <the proc macro crate's name> found
location searched: registry `crates-io`
required by package `rules_rust_fake_proc_macro_root v0.0.0 (/tmp/.tmp79Nulh)`

Error: Failed to generate features

Caused by:
    Failed to run cargo tree: exit status: 101

this error seems to happen in v0.49.1. everything works fine in v0.48.0

I've made a simple project reproducing this issue here.

maybe its related to #2749? @illicitonion?

goniz commented

We're hitting this as well on 0.49.1 !