Cargo build force continue?

Suppose crate foo depends on a, b, c, d, e, f, g.

Suppose crate a has a build error. Does cargo build stop the entire process?

Is there a way to force it to continue building b, c, d, e, f, g, even though ti can not complete foo ?

Context: cargo build --timings; and when refactoring, I just want to see as much timing data as possible, even if one crate fails.

Assuming crates b-g aren't dependent on crate a, if they already started building cargo will wait for them to finish, but cargo won't start compiling any other crates. If the crates are dependent on a, they can't be built if a can't. As far as I'm aware, there is no option to force cargo to build every crate it can. I personally would suggest making liberal use of the todo! or similar tricks to ensure that crate a can build.

You can use the unstable --keep-going flag I think.

3 Likes

Appears to work. Full command for anyone curious:

cargo +nightly -Z unstable-options build --release --timings --keep-going

1 Like