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 dist followed by x.py build compiler/rustc causes rustc to be rebuilt #97481

Open
the8472 opened this issue May 28, 2022 · 4 comments
Open
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@the8472
Copy link
Member

the8472 commented May 28, 2022

Observed behavior:

$ ./x.py dist --stage 1
Updating only changed submodules
  Submodules updated in 0.00 seconds
Building rustbuild
    Finished dev [unoptimized] target(s) in 0.09s
Generating unstable book md files (x86_64-unknown-linux-gnu)
Building stage0 tool unstable-book-gen (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.09s
Building stage0 tool rustbook (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.11s
Rustbook (x86_64-unknown-linux-gnu) - unstable-book
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.09s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.14s
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Assembling stage1 compiler (x86_64-unknown-linux-gnu)
Documenting standalone (x86_64-unknown-linux-gnu)
Building rustdoc for stage1 (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.10s
Documenting book redirect pages (x86_64-unknown-linux-gnu)
Documenting stage1 std (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.15s
    Finished release [optimized] target(s) in 0.13s
    Finished release [optimized] target(s) in 0.16s
    Finished release [optimized] target(s) in 0.12s
    Finished release [optimized] target(s) in 0.12s
Documenting error index (x86_64-unknown-linux-gnu)
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.09s
Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.13s
Copying stage1 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)

[...]

Build completed successfully in 0:04:52


$ ./x.py build --stage 1 compiler/rustc
Updating only changed submodules
  Submodules updated in 0.01 seconds
Building rustbuild
    Finished dev [unoptimized] target(s) in 0.09s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.09s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling jemalloc-sys v0.5.0+5.3.0
^C  Building [=======================> ] 239/242: jemalloc-sys(build)          

Expected behavior: The build should use the cached artifacts

Tested on b97bfc3

@the8472 the8472 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. labels May 28, 2022
@jyn514
Copy link
Member

jyn514 commented Jul 10, 2022

This looks suspicious:

// It seems that PlainSourceTarball somehow changes how some of the tools
// perceive their dependencies (see #93033) which would invalidate fingerprints
// and force us to rebuild tools after vendoring dependencies.
// To work around this, create the Tarball after building all the tools.
dist::PlainSourceTarball,

#93033

@jyn514
Copy link
Member

jyn514 commented Jul 11, 2022

Oh, this might just be because we create a .cargo/config.toml file that uses vendored sources? @the8472 if you delete .cargo, does it fix your issue? (Trying to test this locally, but cargo vendor is painfully slow unfortunately ...)

@jyn514
Copy link
Member

jyn514 commented Jul 11, 2022

I wasn't able to replicate this. (The vendoring changed in #97513; maybe that fixed it by accident?)

@jyn514
Copy link
Member

jyn514 commented Sep 19, 2022

@the8472 are you still running into this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

No branches or pull requests

2 participants