Allow individual build in workspace

Hello all,

In a workspace, can I build a member alone ?

I was using in cpp a static lib created in a standalone project in rust.
I've now integrated this project as a member of a workspace, but for a reason i can't understand, the newly created .lib give me compile problems (rust_alloc and so on ???)

Whatever, every time I want to build the project individually, its .lib finish in the global-workspace target.
But if I isolate the crate alone, building it alone, it works again. How can I specify a member of a workspace to build itself in another place ?

Thanks!

You can use cargo build -p fancy_name to only build fancy_name.

1 Like

Ok I found the trick.

For information, if the crate that is a member is below the workspace manifesto like
A
| Cargo.toml (member = src/B)
| src
| B

you cannot build B individually.
You have to move the member at the same level as the workspace manifest

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.