Add rustbuild command `bench`
Add command bench to rustbuild, so that `./x.py bench <path>` can compile and run benchmarks.
`./x.py bench --stage 1 src/libcollections` and `./x.py bench --stage 1 src/libstd` should both compile well. Just `./x.py bench` runs all benchmarks for the libstd crates.
Fixes #37897
doc_step: String,
build_step: String,
test_step: String,
+ bench_step: String,
}
/// The various "modes" of invoking Cargo.
if self.config.verbose || self.flags.verbose {
cargo.arg("-v");
}
- if self.config.rust_optimize {
+ // FIXME: cargo bench does not accept `--release`
+ if self.config.rust_optimize && cmd != "bench" {
cargo.arg("--release");
}
if self.config.vendor {
/// Get the space-separated set of activated features for the standard
/// library.
fn std_features(&self) -> String {
- let mut features = String::new();
+ let mut features = "panic-unwind".to_string();
if self.config.debug_jemalloc {
features.push_str(" debug-jemalloc");
}