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

x.py check creates work for itself #82461

Closed
jyn514 opened this issue Feb 24, 2021 · 3 comments · Fixed by #84484
Closed

x.py check creates work for itself #82461

jyn514 opened this issue Feb 24, 2021 · 3 comments · Fixed by #84484
Assignees
Labels
A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jyn514
Copy link
Member

jyn514 commented Feb 24, 2021

I tried this: x.py check && x.py check

I expected to see this happen: The first invocation does as much work as it needs to, and the second invocation does no work at all.

Instead, this happened: The second invocation checks rustdoc, clippy, and bootstrap twice.

Checking stage0 rustdoc artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking cfg-if v0.1.10
    Checking lazy_static v1.4.0
    Checking regex-syntax v0.6.22
    Checking itoa v0.4.6
    Checking libc v0.2.85
    Checking memchr v2.3.3
    Checking ryu v1.0.5
    Checking crossbeam-utils v0.7.2
    Checking crossbeam-utils v0.6.6
    Checking thread_local v1.0.1
    Checking serde_json v1.0.59
    Checking aho-corasick v0.7.13
    Checking pulldown-cmark v0.8.0
    Checking crossbeam-epoch v0.8.2
    Checking crossbeam-queue v0.1.2
    Checking getrandom v0.1.14
    Checking num_cpus v1.13.0
    Checking crossbeam-deque v0.7.3
    Checking rand_core v0.5.1
    Checking rustc-rayon-core v0.3.0
    Checking rand_chacha v0.2.2
    Checking rand v0.7.3
    Checking rustc-rayon v0.3.0
    Checking tempfile v3.1.0
    Checking regex v1.4.3
    Checking rustdoc v0.0.0 (/home/joshua/rustc2/src/librustdoc)
    Checking rustdoc-tool v0.0.0 (/home/joshua/rustc2/src/tools/rustdoc)
    Finished release [optimized] target(s) in 3.72s
Checking stage0 cranelift artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
warning: field is never read: `update_symbols`
  --> src/archive.rs:33:5
   |
33 |     update_symbols: bool,
   |     ^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: 1 warning emitted

    Finished release [optimized] target(s) in 0.03s
Checking stage0 clippy artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking serde_json v1.0.59
    Checking cargo_metadata v0.12.0
    Checking clippy_lints v0.1.52 (/home/joshua/rustc2/src/tools/clippy/clippy_lints)
    Checking clippy v0.1.52 (/home/joshua/rustc2/src/tools/clippy)
    Finished release [optimized] target(s) in 4.53s
Checking stage0 bootstrap artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking cfg-if v0.1.10
    Checking lazy_static v1.4.0
    Checking regex-syntax v0.6.22
    Checking itoa v0.4.6
    Checking memchr v2.3.3
    Checking libc v0.2.85
    Checking ryu v1.0.5
    Checking log v0.4.11
    Checking thread_local v1.0.1
    Checking crossbeam-utils v0.7.2
    Checking serde_json v1.0.59
    Checking aho-corasick v0.7.13
    Checking bstr v0.2.13
    Checking time v0.1.43
    Checking filetime v0.2.12
    Checking num_cpus v1.13.0
    Checking regex v1.4.3
    Checking globset v0.4.5
    Checking ignore v0.4.16
    Checking bootstrap v0.0.0 (/home/joshua/rustc2/src/bootstrap)
    Finished release [optimized] target(s) in 3.95s
Build completed successfully in 0:00:13

Meta

Currently rebasing #79341 over fe1bf8e, but this has been happening for the last few weeks so I would expect any parent commit of fe1bf8e, to reproduce the issue.

@jyn514 jyn514 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust labels Feb 24, 2021
@jyn514
Copy link
Member Author

jyn514 commented Feb 24, 2021

I think the issue might be that some dependencies are shared between bootstrap and rustdoc? I'm not 100% sure.

@Mark-Simulacrum
Copy link
Member

Yeah, there's definitely something odd going on. Running with CARGO_LOG=cargo::core::compiler::fingerprint=info gives me this log for the second build (which should be clean, no rebuilding).

It's a bit noisy and hard to tell, but at least it looks like RUSTFLAGS is changing - -Zunstable-options gets omitted in one of the cases, which seems unexpected. Not sure why that's happening.

@jyn514
Copy link
Member Author

jyn514 commented Feb 24, 2021

It's a bit noisy and hard to tell, but at least it looks like RUSTFLAGS is changing - -Zunstable-options gets omitted in one of the cases, which seems unexpected. Not sure why that's happening.

Oh hmm, good catch. I expect this is what changes it:

rust/src/bootstrap/check.rs

Lines 330 to 332 in fe1bf8e

if $path == "src/tools/rustdoc" || $path == "src/tools/clippy" {
cargo.rustflag("-Zunstable-options");
}
which means this is probably a regression from #81271. Is there a way to pass that flag only for the final crate and not the dependencies?

@jyn514 jyn514 self-assigned this Apr 23, 2021
m-ou-se added a commit to m-ou-se/rust that referenced this issue Apr 28, 2021
Don't rebuild rustdoc and clippy after checking bootstrap

This works by unconditionally passing -Z unstable-options to the
compiler. This has no affect in practice since bootstrap doesn't use
`deny(rustc::internal)`.

Fixes rust-lang#82461.

r? `@Mark-Simulacrum`
jackh726 added a commit to jackh726/rust that referenced this issue Apr 29, 2021
Don't rebuild rustdoc and clippy after checking bootstrap

This works by unconditionally passing -Z unstable-options to the
compiler. This has no affect in practice since bootstrap doesn't use
`deny(rustc::internal)`.

Fixes rust-lang#82461.

r? ``@Mark-Simulacrum``
@bors bors closed this as completed in 43afe76 Apr 29, 2021
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue May 6, 2021
Don't rebuild rustdoc and clippy after checking bootstrap

This works by unconditionally passing -Z unstable-options to the
compiler. This has no affect in practice since bootstrap doesn't use
`deny(rustc::internal)`.

Fixes rust-lang/rust#82461.

r? ```@Mark-Simulacrum```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants