]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #67760 - Mark-Simulacrum:rustc-dirty, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 8 Jan 2020 09:03:46 +0000 (09:03 +0000)
committerbors <bors@rust-lang.org>
Wed, 8 Jan 2020 09:03:46 +0000 (09:03 +0000)
commit87540bd3bca8dcd86223261f8c76c5bbf6811ee6
tree979dbdaf6603ef186508eaf47cd6b63a3fa8e134
parentf48e576756cd0c360e5522974fc8d5867b439092
parentccd8c8c89027b32c5dc19c1471deae588baf38ce
Auto merge of #67760 - Mark-Simulacrum:rustc-dirty, r=alexcrichton

Clear out target directory if compiler has changed

Previously, we relied fully on Cargo to detect that the compiler had changed and
it needed to rebuild the standard library (or later "components"). This used to
not quite be the case prior to moving to LLVM be a separate cargo invocation;
subsequent compiles would recompile std and friends if LLVM had changed
(#67077 is the PR that changes things here).

This PR moves us to clearing out libstd when it is being compiled if the rustc
we're using has changed. We fairly harshly limit the cases in which we do this
(e.g., ignoring dry run mode, and so forth, as well as rustdoc invocations).
This is primarily because when we're not using the compiler directly, so
clearing out in other cases is likely to lead to bugs, particularly as our
deletion scheme is pretty blunt today (basically removing more than is needed,
i.e., not just the rustc artifacts).

In practice, this targeted fix does fix the known bug, though it may not fully
resolve the problem here. It's also not clear that there is a full fix hiding
here that doesn't involve a more major change (like -Zbinary-dep-depinfo was).

As a drive-by fix, don't delete the compiler before calling Build::copy, as that
also deletes the compiler.
src/bootstrap/builder.rs