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

rustbuild doesn't rebuild rustdoc dependencies when libstd changes #44739

Closed
arielb1 opened this issue Sep 21, 2017 · 2 comments
Closed

rustbuild doesn't rebuild rustdoc dependencies when libstd changes #44739

arielb1 opened this issue Sep 21, 2017 · 2 comments
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

@arielb1
Copy link
Contributor

arielb1 commented Sep 21, 2017

Meta

Found to occur in commit e2504cf (Sep 21)

STR

config.toml content:

rust/build$ sed -r -e 's/^#.*$//' -e '/^$/d' config.toml
[llvm]
ccache = true
[build]
[install]
[rust]
debuginfo-lines = true
[target.x86_64-unknown-linux-gnu]
[dist]

I reproduced this in an out-of-tree build, but I believe it also happens everywhere

rust/build$ ../x.py build
...
Build completed successfully
rust/build$ touch ../src/libstd/lib.rs # modify libstd
rust/build$ ../x.py build
...
Building rustdoc for stage2 (x86_64-unknown-linux-gnu)
    <--- COMMENT MINE: RUSTDOC NOT REBUILT!
    Finished release [optimized] target(s) in 0.0 secs
Build completed successfully in 0:30:17

Build completed successfully
rust/build$ touch ../src/librustdoc/lib.rs # make rustdoc be recomp
rust/build$ ../x.py build
Updating submodules
error: could not lock config file /home/ariel/Rust/rust/.git/modules/src/liblibc/config: File exists
    Finished dev [unoptimized] target(s) in 0.0 secs
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Copying stage0 test 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.0 secs
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)
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage1 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Copying stage1 test 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.0 secs
Copying stage1 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Assembling stage2 compiler (x86_64-unknown-linux-gnu)
Uplifting stage1 std (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Copying stage2 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Uplifting stage1 test (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Copying stage2 test from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building rustdoc for stage2 (x86_64-unknown-linux-gnu)
   Compiling rustdoc v0.0.0 (file:///home/ariel/Rust/rust/src/librustdoc)
error[E0460]: found possibly newer version of crate `std` which `env_logger` depends on
  --> /home/ariel/Rust/rust/src/librustdoc/lib.rs:30:1
   |
30 | extern crate env_logger;
   | ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: perhaps that crate needs to be recompiled?
   = note: crate `std` path #1: /home/ariel/Rust/rust/build/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-5e8ebc384e5dfd82.rlib
   = note: crate `std` path #2: /home/ariel/Rust/rust/build/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-5e8ebc384e5dfd82.so
   = note: crate `env_logger` path #1: /home/ariel/Rust/rust/build/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libenv_logger-33a5881d598f012b.rlib

error: aborting due to previous error

error: Could not compile `rustdoc`.

To learn more, run the command again with --verbose.


command did not execute successfully: "/home/ariel/Rust/rust/build/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--manifest-path" "/home/ariel/Rust/rust/src/tools/rustdoc/Cargo.toml"
expected success, got: exit code: 101


failed to run: /home/ariel/Rust/rust/build/build/bootstrap/debug/bootstrap build
@arielb1 arielb1 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) WG-infra-rustbuild labels Sep 21, 2017
@arielb1
Copy link
Contributor Author

arielb1 commented Sep 21, 2017

cc @Mark-Simulacrum

@arielb1
Copy link
Contributor Author

arielb1 commented Sep 21, 2017

To anyone who encounters this bug: you can force a rebuild and continue working using:

$ rm ./build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/*

@aidanhs aidanhs added the C-bug Category: This is a bug. label Sep 21, 2017
bors added a commit that referenced this issue Oct 20, 2017
Make sure to clear out the stageN-{rustc,std,tools} directories.

We copy built tool binaries into a dedicated directory to avoid deleting them,
stageN-tools-bin.  These aren't ever cleared out by code, since there should be
no reason to do so, and we'll simply overwrite them as necessary.

When clearing out the stageN-{std,rustc,tools} directories, make sure to delete
both Cargo directories -- per-target and build scripts. This ensures that
changing libstd doesn't cause problems due to build scripts not being rebuilt,
even though they should be.

Fixes #44739.
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