Open
Description
To describe the situation, I created the following small repository:
https://github.com/vbkaisetsu/rules-rust-link-fails-repro
Steps to reproduce
-
Clone the repository.
git clone https://github.com/vbkaisetsu/rules-rust-link-fails-repro.git
-
Run the test.
cd rules-rust-link-fails-repro bazel run //repro:my_lib_doc_test
-
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
-
Run the test with optimization.
bazel run -c opt //repro:my_lib_doc_test
-
Change
cfg
ofproc_macro_deps
fromexec
totarget
.
rules_rust/rust/private/rust.bzl
Line 575 in 82b650d