Clippy gets rebuilt twice on every change, and rustdoc also gets rebuilt
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Something seems wrong with the rebuild tracking for clippy in x.py, making working on clippy in the rustc repo (e.g. when fixing breakage from a rustc change) quite slow due to the multi-minute edit-compile cycle:
./x.py test clippy --stage 2 --bless -- local
# change something in clippy_lints
./x.py test clippy --keep-stage 0 --stage 2 --bless -- local
The last command does
Building stage0 tool lld-wrapper (x86_64-unknown-linux-gnu)
Finished `release` profile [optimized + debuginfo] target(s) in 0.15s
Building stage1 library artifacts (x86_64-unknown-linux-gnu)
Finished `release` profile [optimized + debuginfo] target(s) in 0.06s
Building compiler artifacts (stage1 -> stage2, x86_64-unknown-linux-gnu)
Finished `release` profile [optimized + debuginfo] target(s) in 0.28s
Creating a sysroot for stage2 compiler (use `rustup toolchain link 'name' build/host/stage2`)
Building stage1 tool lld-wrapper (x86_64-unknown-linux-gnu)
Finished `release` profile [optimized + debuginfo] target(s) in 0.14s
Uplifting library (stage1 -> stage2)
Uplifting rustc (stage1 -> stage3)
Building tool clippy-driver (stage2 -> stage3, x86_64-unknown-linux-gnu)
Compiling clippy_lints v0.1.83 (/home/r/src/rust/rustc/src/tools/clippy/clippy_lints)
Compiling clippy v0.1.83 (/home/r/src/rust/rustc/src/tools/clippy)
Finished `release` profile [optimized + debuginfo] target(s) in 1m 16s
Building tool rustdoc (stage1 -> stage2, x86_64-unknown-linux-gnu)
Compiling rustdoc v0.0.0 (/home/r/src/rust/rustc/src/librustdoc)
Compiling rustdoc-tool v0.0.0 (/home/r/src/rust/rustc/src/tools/rustdoc)
Finished `release` profile [optimized + debuginfo] target(s) in 54.20s
Testing clippy (stage2 -> stage3, x86_64-unknown-linux-gnu)
Compiling clippy_config v0.1.83 (/home/r/src/rust/rustc/src/tools/clippy/clippy_config)
Compiling clippy_utils v0.1.83 (/home/r/src/rust/rustc/src/tools/clippy/clippy_utils)
Compiling clippy_lints v0.1.83 (/home/r/src/rust/rustc/src/tools/clippy/clippy_lints)
Compiling clippy v0.1.83 (/home/r/src/rust/rustc/src/tools/clippy)
Finished `release` profile [optimized + debuginfo] target(s) in 1m 24s
Running unittests src/driver.rs (build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/clippy_driver-11f2fd5bded4b22e)
That's a lot more Compiling ... lines than I would expect, and the entire thing takes so long (>4 minutes, which is longer than it takes my machine to build all of rustc!) to make iteration and testing painful.
The most surprising part is that rustdoc gets rebuilt?!? But building clippy twice also seems like something went wrong somewhere.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the x.py rebuild tracking involved in the provided clippy test command, then trace why clippy-driver is built twice and why rustdoc is rebuilt. Use the command and its build output as the reproduction case, with clippy_lints, librustdoc, and tools/rustdoc as the named components. Done means an unchanged rustc change followed by a clippy edit no longer triggers redundant builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100