Skip to content

cargo install doesn't follow workspace target #5662

Closed
@xzn

Description

@xzn

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions