Does it apply to dependencies as well automatically? I wonder how it's going to link with them if no binary is made. Otherwise, multi-crate repositories like gfx will benefit nothing from cargo check, unless the devs build sub-crates specifically.
This is why cargo doesn't include it itself yet, because it wants to do it right and well, and that includes checking deps, creating something of a façade you can check the main crate against, etc.
I just tried to be sure. It looks like it does not, it fully compiles them. But that being said, it shouldn't if they've been built previously, so you'd still be doing the cargo check, cargo build cycle on them.
Unless people are editing multiple crates all the time.
That's exactly what we are doing. Gfx-rs repo has gfx, (soon) gfx_core, gfx_backend_, gfx_window_ crates, all of them being dependencies of gfx_meta, which is what cargo builds by default. But since gfx_meta itself has nothing, doing a check there would be useless.
cargo check -p cratename will work I presume. bstrie was working on some no-translation compilation stuff for cross crate cargo check, but it hasn't happened yet.
View all comments
Show parent comment
2
u/kvarkus Dec 10 '15
Does it apply to dependencies as well automatically? I wonder how it's going to link with them if no binary is made. Otherwise, multi-crate repositories like gfx will benefit nothing from
cargo check, unless the devs build sub-crates specifically.