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

How to compiletest workspace child crates? #147

Closed
aldanor opened this issue Nov 16, 2018 · 2 comments
Closed

How to compiletest workspace child crates? #147

aldanor opened this issue Nov 16, 2018 · 2 comments

Comments

@aldanor
Copy link

aldanor commented Nov 16, 2018

If there's a workspace and the crate foo being tested lives in a subfolder foo/, how do you compile-test it? (in a workspace, the target/ folder is at the workspace root) What should target_rustcflags be set to?

The only way I could make it work was with

  • cd foo && cargo test --target-dir ./target (and setting flags to -L target/debug -L target/debug/deps). But this is kind of ugly and brittle, and requires setting target-dir manually.

Simply running cargo test from either the root folder or the crate subfolder doesn't seem to work (Can't find crate foo). Setting link flags to -L ../target/debug doesn't solve it either.

@aldanor
Copy link
Author

aldanor commented Nov 16, 2018

Using .link_deps() adds proper link paths, like -L /path/to/workspace/target/debug, but it still fails to compile.

Upd: after running cargo clean, it did work for a few times, until in a few runs it stopped working due to "Some errors occurred: E0463, E0464" (how can you even have both at the same time? i.e. crate missing and multiple matching crates)

Upd: it looks like it stops working after running either cargo clippy or cargo check. I've double checked, .clean_rmeta() indeed cleans all target/debug/deps/*.rmeta files created by either of those commands, but it doesn't help and still causes E0463/E0464.

@aldanor
Copy link
Author

aldanor commented Nov 17, 2018

Closing since it since to be related to #114

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

1 participant