-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Cache tarpaulin on Travis CI #311
Conversation
Currently the recommended instructions say to use `cargo install -f`, which always rebuilds tarpaulin even if it's already installed. Removing the -f caches the build if it already exists.
It's worth noting that prior versions of In rust-lang/cargo#7560, soon to be released in Cargo 1.41.0 which is scheduled for approximately a month from now, the However, since the install-upgrade behavior hasn't reached stable Rust/stable Cargo, I'd say this change to the README should wait until it has, just to avoid confusion. |
As an end-user, I don't particularly care whether I'm running the latest and greatest version of tarpaulin. I do care about having builds run 10 minutes faster though. I know this is personal preference and I can close this PR if you don't agree, but in that case the readme should mention that caching |
Don't worry about what I think! 😁 I like this change, I was just adding some context to why Digging further, I stand corrected. I think the main reason we needed the I should expand on what I said, just for completeness, and note one other quirk with Cargo's current behavior. The current (stable) behavior of [kristofer@meson ~]$ cargo +stable install cargo-tarpaulin
Updating crates.io index
error: binary `cargo-tarpaulin` already exists in destination as part of `cargo-tarpaulin v0.10.0`
Add --force to overwrite (Here, Cargo exited with with status 101.) So if we remove the [kristofer@meson ~]$ cargo +beta install cargo-tarpaulin
Updating crates.io index
Ignored package `cargo-tarpaulin v0.10.0` is already installed, use --force to override which is printed before Cargo exits with status 0, indicating success. This is a much softer failure, and perfectly pairs with this PR. I do see and wholeheartedly agree with the motivation here. An installation of My only nit is that if this change is released before v1.41.0 of Cargo is released, the (modified) recommended configuration would produce errors on stable (v1.40.0) Rust builds with cached Perhaps a temporary change could be to before_cache: |
if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
cargo install cargo-tarpaulin -f
elif [[ "$TRAVIS_RUST_VERSION" == beta ]] || [[ "$TRAVIS_RUST_VERSION" == nightly ]]; then
cargo install cargo-tarpaulin
fi Here |
The reason force was in there was because before proc-macro stabilisation when you had to run tarpaulin on nightly it would only work on projects built with the same nightly version as it was built with which would cause CI crashes when a new nightly was released and tarpaulin was cached in CI. That's no longer the case so I'll merge this 👍 |
Ah hadn't realised that change wasn't in cargo stable currently. 1.41 is set to be released 2020-01-30 so if I'm set to release another version before then I'll add a note to the readme |
This doesn't cause a build failure because it's in |
Currently the recommended instructions say to use
cargo install -f
, which always rebuilds tarpaulin even if it's already installed. Removing the -f caches the build if it already exists, which can speed up builds by 10 minutes or more.