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

[E0464]: multiple matching crates after using cargo check #78

Closed
hdhoang opened this issue Oct 9, 2017 · 3 comments
Closed

[E0464]: multiple matching crates after using cargo check #78

hdhoang opened this issue Oct 9, 2017 · 3 comments

Comments

@hdhoang
Copy link
Contributor

hdhoang commented Oct 9, 2017

Running cargo check creates a .rmeta file with a different hash than the actual rlib built. This makes cargo test unable to compile tests which import the tested crate for integration testing.

This travis build fails because of the duplicate files https://travis-ci.org/hdhoang/testee/jobs/285433441#L481
It runs fine after removing the rmeta file https://travis-ci.org/hdhoang/testee/builds/285434745#L443

This is possibly related to rust-lang/cargo#3501. Until check and build use the same metadata, this issue would hinder compiletest-rs adoption.

I think we can workaround this by removing the relevant rmeta files when building tests.

@laumann
Copy link
Collaborator

laumann commented Oct 9, 2017

That does seem annoying... Could removal of the *.rmeta be done as part of the test initialization or is that too late? If it's too late, then I'm not sure this is fixable in compiletest. A feature of Config could be to clear out *.rmeta in build folders on request.

As a side question, why use cargo check for integration testing? Is it even necessary (to run tests, you'd have to run build at some point anyway).

@hdhoang
Copy link
Contributor Author

hdhoang commented Oct 10, 2017

Thank you for your pointer, I'll try that out.

I run cargo check during normal development, but it still creates the conflicting *.rmeta discovered from tests/run-pass/*.rs. Later, cargo test gets confused by those during actual testing.

@laumann
Copy link
Collaborator

laumann commented Oct 10, 2017

I run cargo check during normal development

Ah, I see. It's not the test suite that runs cargo check, sorry :-)

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