From 945f2b485a9e9436790ad503fadfe7ca48495d24 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 20 Mar 2018 11:18:21 +0100 Subject: [PATCH 1/5] travis: avoid recompiling crater multiple times --- .travis.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e0cdd6d61..d3597fff6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ rust: env: global: + - RUSTFLAGS=-Dwarnings # Versions known to work with pinned nightly. - CLIPPY_VERSION=0.0.180 - RUSTFMT_VERSION=0.3.6 @@ -26,10 +27,8 @@ before_script: cargo install-update -i "rustfmt-nightly:$RUSTFMT_VERSION" fi script: + - cargo build && cargo test - | - RUSTFLAGS=-Dwarnings cargo build && - cargo test + [[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo fmt -- --write-mode diff - | - [[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || RUSTFLAGS=-Dwarnings cargo fmt -- --write-mode diff - - | - [[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || RUSTFLAGS=-Dwarnings cargo clippy + [[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo clippy From 70ce38d56f00cba13d45f45d590d3259742e103a Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 20 Mar 2018 18:04:58 +0100 Subject: [PATCH 2/5] travis: switch to rustfmt-preview for style checks --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d3597fff6..f90859b48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ env: - RUSTFLAGS=-Dwarnings # Versions known to work with pinned nightly. - CLIPPY_VERSION=0.0.180 - - RUSTFMT_VERSION=0.3.6 before_script: - export PATH=$HOME/.cargo/bin:$PATH @@ -23,12 +22,12 @@ before_script: fi - | if [[ $TRAVIS_RUST_VERSION =~ nightly-* ]]; then + rustup component add rustfmt-preview cargo install-update -i "clippy:$CLIPPY_VERSION" - cargo install-update -i "rustfmt-nightly:$RUSTFMT_VERSION" fi script: - - cargo build && cargo test - | [[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo fmt -- --write-mode diff + - cargo build && cargo test - | [[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo clippy From 581e3e8ce5397d6fed642512783a238ae462f365 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 20 Mar 2018 21:26:39 +0100 Subject: [PATCH 3/5] travis: always test the latest beta and nightly --- .travis.yml | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index f90859b48..bf197ba74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,33 +1,52 @@ sudo: false dist: trusty + language: rust cache: cargo -rust: - - stable - - nightly-2018-01-20 env: global: - RUSTFLAGS=-Dwarnings - # Versions known to work with pinned nightly. + # Versions known to work with pinned nightly for lints. - CLIPPY_VERSION=0.0.180 +matrix: + include: + # Tests on all the channels + - env: TASK=test + rust: stable + - env: TASK=test + rust: beta + - env: TASK=test + rust: nightly + + # Execute lints with the pinned nightly we know works. + - env: TASK=lint + rust: nightly-2018-01-20 + + # Don't block CI if a nightly is faulty + fast_finish: true + allow_failures: + - rust: nightly + before_script: - export PATH=$HOME/.cargo/bin:$PATH - | - if ! type -p cargo-install-update; then - cargo install --force cargo-update - else - cargo install-update -i cargo-update - fi - - | - if [[ $TRAVIS_RUST_VERSION =~ nightly-* ]]; then + if [[ $TASK = "lint" ]]; then + if ! type -p cargo-install-update; then + cargo install --force cargo-update + else + cargo install-update -i cargo-update + fi + rustup component add rustfmt-preview cargo install-update -i "clippy:$CLIPPY_VERSION" fi script: - | - [[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo fmt -- --write-mode diff - - cargo build && cargo test - - | - [[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo clippy + if [[ $TASK = "lint" ]]; then + cargo fmt -- --write-mode diff + cargo clippy + elif [[ $TASK = "test" ]]; then + cargo build && cargo test + fi From 712f3aa6466c998f0720490cface162028f65120 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 20 Mar 2018 22:08:01 +0100 Subject: [PATCH 4/5] travis: improve code style on travis.yml --- .travis.yml | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index bf197ba74..f943a25b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,24 +29,22 @@ matrix: allow_failures: - rust: nightly -before_script: - - export PATH=$HOME/.cargo/bin:$PATH - - | - if [[ $TASK = "lint" ]]; then - if ! type -p cargo-install-update; then - cargo install --force cargo-update - else - cargo install-update -i cargo-update - fi - - rustup component add rustfmt-preview - cargo install-update -i "clippy:$CLIPPY_VERSION" - fi -script: - - | - if [[ $TASK = "lint" ]]; then - cargo fmt -- --write-mode diff - cargo clippy - elif [[ $TASK = "test" ]]; then - cargo build && cargo test - fi +before_script: | + if [[ $TASK = "lint" ]]; then + if ! type -p cargo-install-update; then + cargo install --force cargo-update + else + cargo install-update -i cargo-update + fi + + rustup component add rustfmt-preview + cargo install-update -i "clippy:$CLIPPY_VERSION" + fi + +script: | + if [[ $TASK = "lint" ]]; then + cargo fmt -- --write-mode diff + cargo clippy + elif [[ $TASK = "test" ]]; then + cargo build && cargo test + fi From c0bd07e9ecab37285767bea6e25364732e4f020e Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 20 Mar 2018 22:45:28 +0100 Subject: [PATCH 5/5] travis: bump pinned nightly --- .travis.yml | 5 +++-- src/cli.rs | 11 +++++------ src/docker.rs | 4 ++-- src/ex.rs | 4 ++-- src/report/mod.rs | 2 +- src/run.rs | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index f943a25b7..8a731af47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,9 @@ cache: cargo env: global: - RUSTFLAGS=-Dwarnings + # Versions known to work with pinned nightly for lints. - - CLIPPY_VERSION=0.0.180 + - CLIPPY_VERSION=0.0.187 matrix: include: @@ -22,7 +23,7 @@ matrix: # Execute lints with the pinned nightly we know works. - env: TASK=lint - rust: nightly-2018-01-20 + rust: nightly-2018-03-07 # Don't block CI if a nightly is faulty fast_finish: true diff --git a/src/cli.rs b/src/cli.rs index 65d98d9e3..c563a5bce 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -70,7 +70,8 @@ pub enum Crater { env: DockerEnv, }, - #[structopt(name = "create-lists", about = "create all the lists of crates")] CreateLists, + #[structopt(name = "create-lists", about = "create all the lists of crates")] + CreateLists, #[structopt(name = "define-ex", about = "define an experiment")] DefineEx { @@ -107,10 +108,7 @@ pub enum Crater { }, #[structopt(name = "copy-ex", about = "copy all data from one experiment to another")] - CopyEx { - ex1: Ex, - ex2: Ex, - }, + CopyEx { ex1: Ex, ex2: Ex }, #[structopt(name = "delete-ex", about = "delete shared data for experiment")] DeleteEx { @@ -174,7 +172,8 @@ pub enum Crater { s3_prefix: Option, }, - #[structopt(name = "serve-report", about = "serve report")] Serve, + #[structopt(name = "serve-report", about = "serve report")] + Serve, } impl Crater { diff --git a/src/docker.rs b/src/docker.rs index 9c231ff01..7de638f0a 100644 --- a/src/docker.rs +++ b/src/docker.rs @@ -104,8 +104,8 @@ pub fn rust_container(config: RustEnv) -> ContainerConfig { ContainerConfig { image_name: IMAGE_NAME, - mounts: mounts, - env: env, + mounts, + env, } } diff --git a/src/ex.rs b/src/ex.rs index d42480868..b92a4cd48 100644 --- a/src/ex.rs +++ b/src/ex.rs @@ -136,9 +136,9 @@ pub fn define_(ex_name: &str, tcs: Vec, crates: Vec, mode: ExM ); let ex = Experiment { name: ex_name.to_string(), - crates: crates, + crates, toolchains: tcs, - mode: mode, + mode, }; fs::create_dir_all(&ex_dir(&ex.name))?; let json = serde_json::to_string(&ex)?; diff --git a/src/report/mod.rs b/src/report/mod.rs index 40fd23d75..d5f8444a2 100644 --- a/src/report/mod.rs +++ b/src/report/mod.rs @@ -63,7 +63,7 @@ pub fn generate_report(config: &Config, ex: &ex::Experiment) -> Result Result