Skip to content

Commit

Permalink
Pin Clippy to a nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
ebroto authored and flip1995 committed Dec 10, 2020
1 parent 6c70133 commit 613333a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 85 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ jobs:
restore-keys: |
${{ runner.os }}-x86_64-unknown-linux-gnu
- name: Master Toolchain Setup
run: bash setup-toolchain.sh

# Run
- name: Set LD_LIBRARY_PATH (Linux)
run: |
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/clippy_bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ matrix.host }}
- name: Master Toolchain Setup
run: bash setup-toolchain.sh
env:
HOST_TOOLCHAIN: ${{ matrix.host }}

# Run
- name: Set LD_LIBRARY_PATH (Linux)
if: runner.os == 'Linux'
Expand Down Expand Up @@ -192,9 +187,6 @@ jobs:
restore-keys: |
${{ runner.os }}-x86_64-unknown-linux-gnu
- name: Master Toolchain Setup
run: bash setup-toolchain.sh

# Run
- name: Build Integration Test
run: cargo test --test integration --features integration --no-run
Expand Down Expand Up @@ -273,9 +265,6 @@ jobs:
restore-keys: |
${{ runner.os }}-x86_64-unknown-linux-gnu
- name: Master Toolchain Setup
run: bash setup-toolchain.sh

# Download
- name: Download target dir
uses: actions/download-artifact@v1
Expand Down
21 changes: 12 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,21 @@ That's why the `else_if_without_else` example uses the `register_early_pass` fun
[early_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/trait.EarlyLintPass.html
[late_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/trait.LateLintPass.html

## Fixing build failures caused by Rust
## Syncing changes from [`rust-lang/rust`] to Clippy

Clippy currently gets built with `rustc` of the `rust-lang/rust` `master`
branch. Most of the times we have to adapt to the changes and only very rarely
there's an actual bug in Rust.
Clippy currently gets built with a pinned nightly version.

If you decide to make Clippy work again with a Rust commit that breaks it, you
have to sync the `rust-lang/rust-clippy` repository with the `subtree` copy of
Clippy in the `rust-lang/rust` repository.
In the `rust-lang/rust` repository, where rustc resides, there's a copy of Clippy
that compiler hackers modify from time to time to adapt to changes in the unstable
API of the compiler.

For general information about `subtree`s in the Rust repository see [Rust's
`CONTRIBUTING.md`][subtree].
We need to sync these changes back to this repository periodically. If you want
to help with that, you have to sync the `rust-lang/rust-clippy` repository with
the `subtree` copy of Clippy in the `rust-lang/rust` repository, and update
the `rustc-toolchain` file accordingly.

For general information about `subtree`s in the Rust repository
see [Rust's `CONTRIBUTING.md`][subtree].

### Patching git-subtree to work with big repos

Expand Down
28 changes: 3 additions & 25 deletions doc/basics.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# Basics for hacking on Clippy

This document explains the basics for hacking on Clippy. Besides others, this
includes how to set-up the development environment, how to build and how to test
Clippy. For a more in depth description on the codebase take a look at [Adding
Lints] or [Common Tools].
includes how to build and test Clippy. For a more in depth description on
the codebase take a look at [Adding Lints] or [Common Tools].

[Adding Lints]: https://github.com/rust-lang/rust-clippy/blob/master/doc/adding_lints.md
[Common Tools]: https://github.com/rust-lang/rust-clippy/blob/master/doc/common_tools_writing_lints.md

- [Basics for hacking on Clippy](#basics-for-hacking-on-clippy)
- [Get the code](#get-the-code)
- [Setup](#setup)
- [Building and Testing](#building-and-testing)
- [`cargo dev`](#cargo-dev)
- [PR](#pr)
Expand Down Expand Up @@ -38,29 +36,9 @@ git rebase upstream/master
git push
```

## Setup

Next we need to setup the toolchain to compile Clippy. Since Clippy heavily
relies on compiler internals it is build with the latest rustc master. To get
this toolchain, you can just use the `setup-toolchain.sh` script or use
`rustup-toolchain-install-master`:

```bash
bash setup-toolchain.sh
# OR
cargo install rustup-toolchain-install-master
# For better IDE integration also add `-c rustfmt -c rust-src` (optional)
rustup-toolchain-install-master -f -n master -c rustc-dev -c llvm-tools
rustup override set master
```

_Note:_ Sometimes you may get compiler errors when building Clippy, even if you
didn't change anything. Normally those will be fixed by a maintainer in a few hours.

## Building and Testing

Once the `master` toolchain is installed, you can build and test Clippy like
every other Rust project:
You can build and test Clippy like every other Rust project:

```bash
cargo build # builds Clippy
Expand Down
4 changes: 3 additions & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
nightly
[toolchain]
channel = "nightly-2020-11-29"
components = ["llvm-tools-preview", "rustc-dev", "rust-src", "rustfmt"]
36 changes: 0 additions & 36 deletions setup-toolchain.sh

This file was deleted.

0 comments on commit 613333a

Please sign in to comment.