Description
I'm following this book here: https://doc.rust-lang.org/book/second-edition/ch14-03-cargo-workspaces.html
and cargo build
works as described. However cargo install
doesn't work in the workspace level, and at crate level it tries to recompile the binary to a target
folder within the crate folder instead of using the workspace level target
folder.
cargo build
from a workspace level also sometimes compiles things differently from cargo install
from the crate. I was trying to compile pijul on Windows earlier and while workspace level cargo build
completes successfully, cargo install pijul
(as well as cargo install
from pijul crate) results in a bunch missing trait implementation errors.
In comparison cargo run
doesn't have this problem as it uses the executables from workspace level target folder. (Although it'd be nice if cargo run
can be used from workspace root directly instead of at crate folder)