Skip to content

workspace cargo build --bin [target] error #5819

@Bert-Proesmans

Description

@Bert-Proesmans

Building a specific bin target with cargo from a workspace root does not work.

I tried this:

  • Have a cargo workspace with two library crates
  • Both crates have autobins = false, but one crate has a manual [[bin]] entry
  • Try to compile the specific bin from the workspace root; cargo build --bin [target]

I expected to see this happen: The binary target gets built.
Because the test-subcommand works as expected..

Instead, this happened: error message
-> error: no bin target named [target]

I'm using cargo 1.27.0 (1e95190 2018-05-27) - Stable toolchain

Note:
cargo build --bins DOES work and compiles all binaries, effectively that one target binary.
changing work-directory into sub crate with bin and running cargo build --bin [target] DOES work and compiles the selected binary.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions