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

Clippy not available through crates.io #236

Closed
orenbenkiki opened this issue May 26, 2019 · 11 comments
Closed

Clippy not available through crates.io #236

orenbenkiki opened this issue May 26, 2019 · 11 comments
Assignees
Labels

Comments

@orenbenkiki
Copy link

This isn't the fault of cargo make of course, but the clippy folk have decided that it will no longer be available through a simple cargo install. I'm sure they have their reasons; I'm too confused about the relationship between cargo install and rustup component add to have an opinion either way (I couldn't find a link that clearly explained it).

Right now, cargo make clippy using rust nightly (on travis) failes with the error:

error: Clippy is no longer available via crates.io
help: please run `rustup component add clippy-preview` instead

Running cargo make clippy still works for stable rust, but it runs the old unmaintained version from crates.io.

One of the things I greatly appreciate about cargo make is that it provides canned recipes for installing and running all sort of utilities, such as kcov and, of course, clippy. I appreciate it is an endless and often thankless job to keep these recipes up to date. So, first, a big thanks here for creating these recipes. And... the clippy recipe needs fixing to deal with whatever-the-right-method-is-these-days to install it.

@sagiegurari
Copy link
Owner

the clippy task tries first cargo install and if fails, it will try rustup.
does it not work? didn't test on stable lately

@orenbenkiki
Copy link
Author

orenbenkiki commented May 26, 2019

See https://travis-ci.org/orenbenkiki/cargo-coverage-annotations
The stable build passed. Looking at the raw log, I can't tell how clippy was installed: https://api.travis-ci.org/v3/job/537501382/log.txt
The nightly build failed. Looking at the raw log, I see it tries and fails to cargo install clippy. There's no indication of trying to use rustup as an alternative: https://api.travis-ci.org/v3/job/537501381/log.txt
At any rate, it seems like the right-thing-to-do-these-days is to directly go to using rustup?
Perhaps trying to use cargo install to get the old unmaintained version if that fails?

@sagiegurari
Copy link
Owner

I'll take a look at it. i usually work with nightly so its a surprise to me

@sagiegurari
Copy link
Owner

ya clippy seems broken on nightly.
on their project page they recommend to try to use git install directly for nightly as the rustup component is not available.
So i'll try to work on that, BUT compiling clippy takes forever, so i'm not 100% sure you would like to wait for it during CI build.
anyway i'll run some tests and check it out.

@sagiegurari
Copy link
Owner

ok so it adds another 6 minutes to travis run time.
i'll add it to cargo-make core makefile and you can add a condition to clippy to disable it if you are in CI + nightly if you don't want to wait those extra 6 minutes i guess.

@orenbenkiki
Copy link
Author

Great, thanks!

It would be nice if Travis allowed for something like sccache between builds to avoid recompiling the same packages all over again... To be fair they do provide some form of cargo caching.

@sagiegurari
Copy link
Owner

i pushed to master a fix for it. can you by any chance also test it by running cargo-make installation via github directly?
if it solves your issues, i'll release it officially.

i'm aware of travis cache, but its easy to forget about it and start running with really outdated stuff.
so I never use it. I know many other projects do use it successfully but i tend to forget stuff :)

@orenbenkiki
Copy link
Author

I got:

before_script
242.49s$ cargo install --git https://github.com/sagiegurari/cargo-make.git --force cargo-make
    Updating git repository `https://github.com/sagiegurari/cargo-make.git`
  Installing cargo-make v0.19.2 (https://github.com/sagiegurari/cargo-make.git#8d915d73)
    Updating crates.io index
 Downloading crates ...
  Downloaded dirs v2.0.0
  Downloaded envmnt v0.4.0
  Downloaded autocfg v0.1.4
  Downloaded ci_info v0.7.0
  Downloaded num-traits v0.2.8
  Downloaded dirs-sys v0.3.1
   Compiling autocfg v0.1.4
   Compiling libc v0.2.55
   Compiling proc-macro2 v0.4.30
   Compiling serde v1.0.91
   Compiling memchr v2.2.0
   Compiling unicode-xid v0.1.0
   Compiling cgmath v0.16.1
   Compiling winapi v0.3.7
   Compiling rand_core v0.4.0
   Compiling regex v1.1.6
   Compiling lazy_static v1.3.0
   Compiling syn v0.15.34
   Compiling ucd-util v0.1.3
   Compiling approx v0.1.1
   Compiling utf8-ranges v1.0.2
   Compiling unicode-width v0.1.5
   Compiling cfg-if v0.1.9
   Compiling rgb v0.8.13
   Compiling strsim v0.8.0
   Compiling vec_map v0.8.1
   Compiling semver-parser v0.7.0
   Compiling ansi_term v0.11.0
   Compiling bitflags v1.0.4
   Compiling glob v0.3.0
   Compiling rust_info v0.2.2
   Compiling num-traits v0.2.8
   Compiling rand_chacha v0.1.1
   Compiling rand_pcg v0.1.2
   Compiling rand v0.6.5
   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.4
   Compiling thread_local v0.3.6
   Compiling regex-syntax v0.6.6
   Compiling textwrap v0.11.0
   Compiling log v0.4.6
   Compiling semver v0.9.0
   Compiling rand_hc v0.1.0
   Compiling rand_xorshift v0.1.1
   Compiling rand_isaac v0.1.1
   Compiling fern v0.5.8
   Compiling rand v0.4.6
   Compiling rand_os v0.1.3
   Compiling users v0.9.1
   Compiling atty v0.2.11
   Compiling dirs-sys v0.3.1
   Compiling quote v0.6.12
   Compiling indexmap v1.0.2
   Compiling toml v0.5.1
   Compiling aho-corasick v0.7.3
   Compiling clap v2.33.0
   Compiling dirs v2.0.0
   Compiling num-traits v0.1.43
   Compiling envmnt v0.4.0
   Compiling run_script v0.3.1
   Compiling ci_info v0.7.0
   Compiling serde_derive v1.0.91
   Compiling winconsole v0.10.0
   Compiling shell2batch v0.3.0
   Compiling colored v1.8.0
   Compiling cargo-make v0.19.2 (https://github.com/sagiegurari/cargo-make.git#8d915d73)
    Finished release [optimized] target(s) in 4m 02s
   Replacing /home/travis/.cargo/bin/cargo-make
   Replacing /home/travis/.cargo/bin/makers
    Replaced package `cargo-make v0.19.1` with `cargo-make v0.19.2 (https://github.com/sagiegurari/cargo-make.git#8d915d73)` (executables `cargo-make`, `makers`)
0.03s$ cargo make ci
[cargo-make] INFO - cargo make 0.19.2
[cargo-make] INFO - Using Build File: Makefile.toml
[cargo-make] INFO - Task: ci
[cargo-make] INFO - Profile: development
thread 'main' panicked at 'Unable to parse base descriptor, data did not match any variant of untagged enum InstallCrate for key `tasks.install-clippy-github.install_crate`', /home/travis/.cargo/git/checkouts/cargo-make-beee6198da581977/8d915d7/src/lib/descriptor.rs:276:23
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
The command "cargo make ci" exited with 101.

You can see the build in: https://travis-ci.org/orenbenkiki/cargo-todox/jobs/537889996
The raw log is in: https://api.travis-ci.org/v3/job/537889996/log.txt

@sagiegurari
Copy link
Owner

ya sorry, think i fixed that

@orenbenkiki
Copy link
Author

Yes, it works now for in my travis build.

I'm trying out more aggressive travis caching as well. In general you can just tell travis which directories to preserve. I'm trying $HOME/.cargo and $HOME/.cache (which should cover both $HOME/.cache/cargo-make and $HOME/.cache/sccache. Will take a few builds with prints to see whether this actually reduces the build times.

@sagiegurari
Copy link
Owner

great. will release an official version later today.
thanks for testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants