Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Docmatic fails when a dependency of the tested crate changed #4

Open
konstin opened this issue Jun 6, 2018 · 2 comments
Open

Docmatic fails when a dependency of the tested crate changed #4

konstin opened this issue Jun 6, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@konstin
Copy link

konstin commented Jun 6, 2018

When changing dependencies in pyo3, docmatic will reproducibly fail to build the doc tests.

This can be easily reproduced by pinning something irrelevant (in this, log 0.4.2) to a lower version: (Requires nightly rust)

git clone https://github.com/PyO3/pyo3
cd pyo3
cargo test
sed -i -e 's/"0.4"/"=0.4.1"/' Cargo.toml
cargo test

The second test run will print a lot of errors like the following:

---- guide/src/function.md - Python_Function (line 36) stdout ----
error[E0464]: multiple matching crates for `pyo3`
 --> guide/src/function.md:40:1
  |
5 | extern crate pyo3;
  | ^^^^^^^^^^^^^^^^^^
  |
  = note: candidates:
          crate `pyo3`: /home/konsti/doc/target/debug/deps/libpyo3-3df255959ab0361f.rlib
          crate `pyo3`: /home/konsti/doc/target/debug/deps/libpyo3-1891f9f7b2b3eea4.rlib

I had this happen on multiple nightlies, so I'm pretty sure it's not a bug in nightly.

@epage epage added the bug Something isn't working label Jun 6, 2018
@epage
Copy link
Contributor

epage commented Jun 6, 2018

Thanks for reporting this! I keep forgetting to myself.

The terrible workaround for this is:

rm -rf target/debug/deps/*pyo3* 

See liquid's .travis.yml

This is a problem that has also long plagued skeptic, see budziq/rust-skeptic#18.

@epage
Copy link
Contributor

epage commented Jun 6, 2018

The root of the issue is we don't pass --extern for this crate to disambiguate it once the build has created different versions of it.

I wonder if we could do a build using escargot to capture what rlibs are created and pass each one in.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants