Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Multiple matching crates for UI tests #81

Open
Nemo157 opened this issue Mar 25, 2018 · 2 comments
Open

Multiple matching crates for UI tests #81

Nemo157 opened this issue Mar 25, 2018 · 2 comments

Comments

@Nemo157
Copy link
Contributor

Nemo157 commented Mar 25, 2018

For some reason after #73 running cargo test && cargo test --manifest-path testcrate/Cargo.toml fails with a lot of error messages like:

error[E0464]: multiple matching crates for `futures_await`
 --> /Users/Nemo157/sources/futures-await/testcrate/ui/unresolved-type.rs:3:1
  |
3 | extern crate futures_await as futures;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: candidates:
          crate `futures_await`: /Users/Nemo157/sources/futures-await/target/debug/deps/libfutures_await-91e2e3a8128ee77e.rlib
          crate `futures_await`: /Users/Nemo157/sources/futures-await/target/debug/deps/libfutures_await-3b1c0c7e78133586.rlib

I applied a workaround for this on CI in #80: https://github.com/alexcrichton/futures-await/commits/c5b06c84b6545870fd4ac2d58a997aabb8a28b3e, but it would be nice to not have to build the whole dependency tree twice, and doesn't solve the issue for developers testing locally that don't know that it is required.

Appears to be related to Manishearth/compiletest-rs#101, opening an issue here so the workaround can be removed once upstream is fixed.

@Nemo157
Copy link
Contributor Author

Nemo157 commented Mar 25, 2018

It seems pinning back to compiletest_rs v0.3.7 instead of allowing use of v0.3.8 avoids this issue for some reason.

@Nemo157
Copy link
Contributor Author

Nemo157 commented Mar 25, 2018

Comparing the changes, I have no idea why these two versions would behave differently.

I think this is actually a symptom of a deficiency in Cargo (compiletest_rs probably needs to do more to workaround it, I don't know if it's fixable in Cargo itself). compiletest_rs v0.3.8 moved from rustc-serialize to serde for serialization, serde_derive depends on syn = { version = "0.12", features = ["visit"] }, futures-await-async-macro depends on syn = { version = "0.12", default-features = false, features = ["full", "fold", "parsing", "printing", "extra-traits"] }. So when building futures-await via cargo test and when building via cargo test --manifest-path testcrate/Cargo.toml the syn dependency is being built with 2 different sets of feature flags, this ripples up the dependency tree and results in two different copies of futures-await being built for these two cases. compiletest_rs then doesn't know which copy is the one it should be testing and fails.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant