Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The great Travis speedup #200

Merged
merged 5 commits into from
Mar 21, 2018
Merged

The great Travis speedup #200

merged 5 commits into from
Mar 21, 2018

Conversation

pietroalbini
Copy link
Member

@pietroalbini pietroalbini commented Mar 20, 2018

Important: all the Travis caches needs to be cleaned before merging this. The old stable cache is broken as far as I understand, and the migration to rustfmt-preview may cause problems to the lints job. Anyone with push access to this repo can do it on this page, with the "delete all repository caches" button.


Travis speed on this repository is pretty bad (not rustc-bad, but a simple commit takes more than 20 minutes to test), and with this PR I'm trying to solve that. There are a few problems at the moment:

  1. Travis rebuilds all the dependencies two times on each build, since the build/clippy step is done with RUSTFLAGS=-Dwarnings and the test one without
  2. Only the stable channel is actually tested: the beta one is missing, and the nightly one is pinned to a specific date (thanks clippy!)
  3. The "lints job" uses a pinned version of rustfmt, so we need to check if it works every time we bump the pinned nightly: now that the rustfmt-preview component is available we can use it instead
  4. The pinned nightly (and so rustfmt/clippy) is a bit old, so the latest versions of the tools I use locally produce different output than CI

This PR addresses those problems:

  1. All the cargo calls now are done with RUSTFLAGS=-Dwarnings, so it doesn't invalidate all the cached dependencies multiple times on each build
  2. I added a build job for beta and nightly (different than the one used for lints), and I allowed the nightly one to fail without failing the build (I don't want to block CI if there is a regression)
  3. Switched to using rustfmt-preview on the "nightly lints" job: I'm not doing it everywhere because rustfmt stable wants different things than rustfmt nightly at the moment
  4. Updated the pinned nightly and clippy to the latest working version (there are regressions affecting us in both the nightlies of clippy 0.0.188 and of clippy 0.0.189)

I have to say, the result of this is really good (we go from a 20+ minutes wait to about 3 minutes):

Old builds New builds without cache New builds
stable 18 min 9 min 3 min
beta [not tested] 9 min 3 min
nightly [not tested] 9 min 3 min
nightly lints 22 min 21 min 3 min

@pietroalbini pietroalbini force-pushed the improve-ci branch 10 times, most recently from 4b0569e to 83cfd28 Compare March 20, 2018 19:24
@pietroalbini pietroalbini force-pushed the improve-ci branch 4 times, most recently from c7b5619 to 87eb370 Compare March 20, 2018 20:37
@pietroalbini pietroalbini changed the title Various improvements to CI The great Travis speedup Mar 20, 2018
@pietroalbini
Copy link
Member Author

This PR is now ready to be reviewed/merged. cc @aidanhs

@aidanhs
Copy link
Member

aidanhs commented Mar 21, 2018

All caches cleared - seems ok, let's give it a shot!

@aidanhs aidanhs merged commit 30f3c70 into rust-lang:master Mar 21, 2018
@pietroalbini pietroalbini deleted the improve-ci branch March 21, 2018 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants