serde-xml-rs icon indicating copy to clipboard operation
serde-xml-rs copied to clipboard

serde_xml_rs::Usage fails

Open igor-raits opened this issue 6 years ago • 5 comments

failures:

---- README.md - serde_xml_rs::Usage (line 11) stdout ----
error[E0464]: multiple matching crates for `serde_xml_rs`
 --> README.md:15:1
  |
5 | extern crate serde_xml_rs;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: candidates:
          crate `serde_xml_rs`: /home/brain/rpmbuild/BUILD/serde-xml-rs-0.3.1/target/release/deps/libserde_xml_rs-1dc5f0da41faad4e.rlib
          crate `serde_xml_rs`: /home/brain/rpmbuild/BUILD/serde-xml-rs-0.3.1/target/release/deps/libserde_xml_rs-454cd59720adc4d4.rlib

error[E0463]: can't find crate for `serde_xml_rs`
 --> README.md:15:1
  |
5 | extern crate serde_xml_rs;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

thread 'README.md - serde_xml_rs::Usage (line 11)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:351:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.


failures:
    README.md - serde_xml_rs::Usage (line 11)

igor-raits avatar Apr 27 '19 07:04 igor-raits

I cannot reproduce this on my machine or in CI with the current state of master. However, I have encountered this problem during CI builds when a new version of Rust is released. The first workaround was to clear the build cache. The automated workaround was to add a before_cache clause in the CI script (https://github.com/RReverser/serde-xml-rs/blob/master/.travis.yml#L7-L9).

BTW, in future reports, please include the specific command that was run to produce the error. I assume you ran cargo test, but I can't be certain.

punkstarman avatar Apr 28 '19 09:04 punkstarman

Sorry for not including commands...

It was basically cargo build --release && cargo test --release

igor-raits avatar Apr 28 '19 09:04 igor-raits

@cuviper, what could cause that rust builds another rlib file when running cargo test?

igor-raits avatar Apr 28 '19 09:04 igor-raits

what could cause that rust builds another rlib file when running cargo test?

Wild guess, it may be that some dev-dependencies enable more features on the regular dependencies, causing serde_xml_rs to rebuild to pick that up.

cuviper avatar Apr 30 '19 16:04 cuviper

I think I have narrowed this down to docmatic doing something weird when creating the tests from the README.

decathorpe avatar Jan 11 '21 10:01 decathorpe