-
Notifications
You must be signed in to change notification settings - Fork 2.9k
cargo build --benches also builds tests target for the crate #15258
Copy link
Copy link
Open
Labels
A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)Area: selection and definition of targets (lib, bins, examples, tests, benches)A-cliArea: Command-line interface, option parsing, etc.Area: Command-line interface, option parsing, etc.C-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Metadata
Metadata
Assignees
Labels
A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)Area: selection and definition of targets (lib, bins, examples, tests, benches)A-cliArea: Command-line interface, option parsing, etc.Area: Command-line interface, option parsing, etc.C-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
Hello,
When running
cargo build --benches, one might expect to only build the bench targets.This is also the case for
cargo benchcommand.When building the
Steps
cargo build --benches, see compilation errorPossible Solution(s)
I have not deep dived into the cargo code, but bench targets should not build the test target, especially since benches are generally built in a release profile, it kind of makes no sense to build the targets in the release profile as well.
Notes
Sorry if this makes no sense or if it's a duplicate.
If instructions on how to reproduce are not clear enough I can provide a simple repository!
Version