You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
If there's a workspace and the crate
foo
being tested lives in a subfolderfoo/
, how do you compile-test it? (in a workspace, thetarget/
folder is at the workspace root) What shouldtarget_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.The text was updated successfully, but these errors were encountered: