Add an option to skip building binaries when there are integration tests
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
Problem
https://doc.rust-lang.org/cargo/reference/cargo-targets.html#integration-tests
Binary targets are automatically built if there is an integration test. This allows an integration test to execute the binary
https://github.com/rust-lang/cargo/issues/7958
There is not currently a way to skip building the binaries.
We want to skip it because we don't use this feature, and our project is very slow to compile.
Here we wasted a lot of time to build the unnecessary bins.
Some other users may have other reasons e.g., https://github.com/rust-lang/cargo/issues/7958#issuecomment-1603273755.
Proposed Solution
I feel this is kind of similar to disable auto-discovery https://doc.rust-lang.org/cargo/reference/cargo-targets.html#target-auto-discovery
[package]
# ...
autobins = false
autoexamples = false
autotests = false
autobenches = false
So maybe we can add an option like build-bins-for-integration-tests (Can't come up with a good name, sorry)
Notes
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Cargo targets documentation and issue #7958 to understand why integration tests currently build binary targets and which use cases must remain supported. Define the configuration behavior and its interaction with integration tests, then verify that the selected option skips unnecessary binaries while preserving tests that execute them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100