This introduces a work-around for a bug in rustup.rs when excuting
cargo from a custom toolchain. Instead of trusting rustup to
invoke cargo from one of the release channels we just invoke
nightly cargo directly.
This commit makes `cargo clippy` output the build artifacts to a
separate directory if the `CLIPPY_DOGFOOD` env var is set. This should
prevent dogfood builds from interfering with regular builds.
This should help with issue #2595.
Now that we're using cargo check, we can stop needing to find out the
manifest path ourselves. Instead, we can delegate to cargo check, which
is perfectly capable of working out for itself what needs to be built.
This fixes#1707 and #2518.
Note that this PR will change the output. We will no longer output `bin:
foo` before each crate. This a bit unfortunate. However, given that
we're now going to be building in parallel (which is *much* faster), I
think this is acceptable - we'll be no worse than cargo itself.
Some build scripts rely on the RUSTC binary being the actual compiler
(e.g. parsing the output of 'RUSTC --version'). To prevent clippy from
breaking these build scripts, this commit sets RUSTC_WRAPPER instead.
This will cause Cargo to leave RUSTC unchanged, making the use of clippy
transparent to build scripts.
This implements workspace support for `cargo clippy` by running clippy
over all packages in the workspace (in serial).
This should probably be parallelised in future (as `cargo build --all`).
Before this change, a relative path like `--manifest-path=./Cargo.toml` would
fail to find a matching package in the cargo metadata. With this change,
both the argument and the cargo metadata path are canonicalized before
comparison.