Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctests try to link multiple identical dependency on the same path #5658

Closed
sorpaas opened this issue Jun 27, 2018 · 4 comments
Closed

doctests try to link multiple identical dependency on the same path #5658

sorpaas opened this issue Jun 27, 2018 · 4 comments

Comments

@sorpaas
Copy link

sorpaas commented Jun 27, 2018

I think this is a regression. This works on rustc/cargo 1.26 but fails on rustc/cargo 1.27.

We have a dependency in the project parity-dapps-glue. This crate is published in crates.io, and we have a crate (parity-dapps) depending on the crates.io version. There's another local version of parity-dapps-glue. That local version is not being dependent by any other crates in the project, but it's included as a member of the workspace.

Given we have a checkout of parity:

git clone https://github.com/paritytech/parity
cd parity
git checkout 683a26c8300c7022950bb2d678b82a616b79d434

Go to the parity-dapps-glue folder and run cd dapps/js-glue && cargo test --release --verbose works without any issue. However, when in the root folder of the project, run command cargo test --all --release --verbose fails with the following error:

error[E0465]: multiple rlib candidates for `syntex` found
  --> /home/sorpaas/repos/parity3/dapps/js-glue/src/lib.rs:21:1
   |
21 | extern crate syntex;
   | ^^^^^^^^^^^^^^^^^^^^
   |

Checking the command cargo tries to run:

   Doc-tests parity-dapps-glue
     Running `rustdoc --test /home/sorpaas/repos/parity3/dapps/js-glue/src/lib.rs --crate-name parity_dapps_glue -L dependency=/home/sorpaas/repos/parity3/target/release/deps -L native=/home/sorpaas/repos/parity3/target/release/build/backtrace-sys-e4eacff605b4f055/out/.libs -L native=/home/sorpaas/repos/parity3/target/release/build/eth-secp256k1-0b8b502d1bbb696e/out -L native=/home/sorpaas/repos/parity3/target/release/build/hidapi-a9e9c4be500acaed/out -L native=/home/sorpaas/repos/parity3/target/release/build/libusb-sys-5da7ff895ff6110a/out -L native=/home/sorpaas/repos/parity3/target/release/build/ring-a01f8d7f275bc597/out -L native=/home/sorpaas/repos/parity3/target/release/build/rocksdb-sys-0cc50aca43312c87/out -L native=/home/sorpaas/repos/parity3/target/release/build/rust-crypto-55bc03d3db1ecfb2/out -L native=/home/sorpaas/repos/parity3/target/release/build/snappy-sys-d06997f537a1bcfc/out -L dependency=/home/sorpaas/repos/parity3/target/release/deps --cfg 'feature="with-syntex"' --cfg 'feature="syntex"' --cfg 'feature="default"' --cfg 'feature="quasi"' --cfg 'feature="quasi_codegen"' --cfg 'feature="syntex_syntax"' --extern glob=/home/sorpaas/repos/parity3/target/release/deps/libglob-a2dd3ee8473024ce.rlib --extern glob=/home/sorpaas/repos/parity3/target/release/deps/libglob-f0c88b0834dadf39.rlib --extern mime_guess=/home/sorpaas/repos/parity3/target/release/deps/libmime_guess-82ea2dbb34000842.rlib --extern aster=/home/sorpaas/repos/parity3/target/release/deps/libaster-698a2daf00391c43.rlib --extern mime_guess=/home/sorpaas/repos/parity3/target/release/deps/libmime_guess-aa77cd54b7d2d450.rlib --extern aster=/home/sorpaas/repos/parity3/target/release/deps/libaster-79f91cd1dc587a34.rlib --extern syntex=/home/sorpaas/repos/parity3/target/release/deps/libsyntex-abd568c68cb25604.rlib --extern parity_dapps_glue=/home/sorpaas/repos/parity3/target/release/deps/libparity_dapps_glue-20efa3d1d1c05826.rlib --extern syntex_syntax=/home/sorpaas/repos/parity3/target/release/deps/libsyntex_syntax-fb8bb9b97a7fa6c4.rlib --extern syntex=/home/sorpaas/repos/parity3/target/release/deps/libsyntex-223e04c9da4376ef.rlib --extern quasi=/home/sorpaas/repos/parity3/target/release/deps/libquasi-638391ea1d3064e7.rlib --extern syntex_syntax=/home/sorpaas/repos/parity3/target/release/deps/libsyntex_syntax-eaa12227fbcdf6de.rlib --extern quasi=/home/sorpaas/repos/parity3/target/release/deps/libquasi-6bf50ce5ae2c2f13.rlib`

You can see there're two --extern syntex arguments pointing to different files.

I checked the doctests build for cd dapps/js-glue && cargo test --release --verbose and cargo test --release --all --verbose, they're building with the same feature sets.

  • I expected to see this happen: The above command works just as in rust/cargo 1.26.
  • Instead, this happened: It fails with error.
  • rustc version: rustc 1.27.0 (3eda71b00 2018-06-19)
  • cargo version: cargo 1.27.0 (1e95190e5 2018-05-27)

rel openethereum/parity-ethereum#8983

@sorpaas sorpaas changed the title doctests try to link multiple identical depencendy on the same path doctests try to link multiple identical dependency on the same path Jun 27, 2018
@ehuss
Copy link
Contributor

ehuss commented Jun 28, 2018

Thanks @sorpaas for the report. I have a fix for this in #5651.

@ehuss
Copy link
Contributor

ehuss commented Jul 8, 2018

@sorpaas, if you're able, can you test with the latest nightly? It should be fixed now.

@sorpaas
Copy link
Author

sorpaas commented Jul 10, 2018

Going to try with the previous commit tomorrow.

@ehuss
Copy link
Contributor

ehuss commented Aug 7, 2018

Going to close this for now. @sorpaas if you find any issues, please let me know.

@ehuss ehuss closed this as completed Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants