]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #38008 - bluss:rustbuild-benches, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 26 Nov 2016 18:32:19 +0000 (12:32 -0600)
committerGitHub <noreply@github.com>
Sat, 26 Nov 2016 18:32:19 +0000 (12:32 -0600)
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

1  2 
src/bootstrap/lib.rs

diff --combined src/bootstrap/lib.rs
index b751031e88b53dee565ae1127f916e805a9dd713,518eafb6f36c45015abf7b86d95326c746636a8e..03c74ff081ae0aa3768deb1462cf91a93f04ae80
@@@ -141,6 -141,7 +141,7 @@@ struct Crate 
      doc_step: String,
      build_step: String,
      test_step: String,
+     bench_step: String,
  }
  
  /// The various "modes" of invoking Cargo.
@@@ -457,7 -458,8 +458,8 @@@ impl Build 
          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");
          }