Skip to content

Clippy gets rebuilt twice on every change, and rustdoc also gets rebuilt #131636

Open
@RalfJung

Description

@RalfJung

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-clippyArea: ClippyA-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustC-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions