roblabla / cargo-travis

A cargo subcommand to manage various CI-related jobs in rust.
97 stars 13 forks source link

Add alternative installation instructions that avoids reinstalling cargo-travis #17

Open zbraniecki opened 7 years ago

zbraniecki commented 7 years ago

When trying to use travis-cargo with cache: cargo, I'm seeing the following error on the second run (first with cache):

error: binary `cargo-coverage` already exists in destination as part of `cargo-travis v0.0.5`
binary `cargo-coveralls` already exists in destination as part of `cargo-travis v0.0.5`
Add --force to overwrite

Log: https://travis-ci.org/projectfluent/fluent-locale-rs/builds/287255355

roblabla commented 7 years ago

Does using cargo install --force like the error message says fix the error ?

zbraniecki commented 7 years ago

yes, it does fix the error.

zbraniecki commented 7 years ago

should it be closed? Is --force a solution or workaround to the problem? If it's the solution then maybe it should be documented?

roblabla commented 7 years ago

Is there a problem with the --force solution ? Basically, cargo blows an error if we try to install a crate that's already installed. So either we tell it "nevermind, (re)install it anyway !", or we need to check if we're already installed to avoid doing it. I prefer the former to the later, as it's more robust and forces cargo travis to be kept up to date, but I can see why people might prefer the later (installing cargo-travis takes some time, so shaving a few seconds off their build pipeline might be a good thing).

zbraniecki commented 7 years ago

installing cargo-travis takes some time, so shaving a few seconds off their build pipeline might be a good thing

For me it's ~7 minutes on travis CI so I'd prefer the latter tbh.

roblabla commented 7 years ago

debris is using cargo install cargo-travis || echo "cargo-travis already installed" in his tiny-keccak repository. You can try that.

I'll probably add that as a comment in the provided yaml file.

zbraniecki commented 7 years ago

screenshot from 2017-10-17 11-04-09

I guess it worked! Thank you :)

roblabla commented 7 years ago

No problem :). Keep it mind that with this, you won't get any cargo-travis updates without manually clearing the cache though !

zbraniecki commented 7 years ago

roger that! I think it's ingrained in the term "cache" :) Cutting down the build time from 21 min to 4 min is worth occasional manual cache invalidation for me.