Skip to content

rust_doc_test Failed to link crates when proc-macro is used in the dependencies #980

Open
@vbkaisetsu

Description

@vbkaisetsu

To describe the situation, I created the following small repository:
https://github.com/vbkaisetsu/rules-rust-link-fails-repro

Steps to reproduce

  1. Clone the repository.

    git clone https://github.com/vbkaisetsu/rules-rust-link-fails-repro.git
    
  2. Run the test.

    cd rules-rust-link-fails-repro
    bazel run //repro:my_lib_doc_test
    
  3. The following error occurs:

    exec ${PAGER:-/usr/bin/less} "$0" || exit 1
    Executing tests from //repro:my_lib_doc_test
    -----------------------------------------------------------------------------
    error[E0460]: found possibly newer version of crate `fnv` which `tonic` depends on
     --> repro/my_lib.rs:3:5
      |
    3 | use tonic::Status;
      |     ^^^^^
      |
      = note: perhaps that crate needs to be recompiled?
      = note: the following crate versions were found:
              crate `fnv`: /home/koichi.akabe/.cache/bazel/_bazel_koichi.akabe/65e8d7f25191e794777d18f078967787/execroot/link_fail_repro/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/raze__fnv__1_0_7/libfnv--1978688209.rlib
              crate `tonic`: /home/koichi.akabe/.cache/bazel/_bazel_koichi.akabe/65e8d7f25191e794777d18f078967787/execroot/link_fail_repro/bazel-out/k8-fastbuild/bin/external/raze__tonic__0_5_2/libtonic--506703014.rlib
    
    error: aborting due to previous error
    

Workarounds

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions