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

Clear out target directory if compiler has changed #67760

Merged
merged 1 commit into from
Jan 8, 2020

Commits on Jan 2, 2020

  1. 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
    (rust-lang#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.
    Mark-Simulacrum committed Jan 2, 2020
    Configuration menu
    Copy the full SHA
    ccd8c8c View commit details
    Browse the repository at this point in the history