-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Fix test caching on Windows/GNU #39892
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks @petrochenkov!
src/bootstrap/compile.rs
Outdated
@@ -294,9 +298,7 @@ fn compiler_file(compiler: &Path, file: &str) -> PathBuf { | |||
} | |||
|
|||
pub fn create_sysroot(build: &Build, compiler: &Compiler) { | |||
let sysroot = build.sysroot(compiler); | |||
let _ = fs::remove_dir_all(&sysroot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a somewhat crucial step as it cleans out any old artifacts to make sure we don't preserve anything by accident. Could the *.o
files above be generated into something like build/$target/rtstartup/foo.o
and then copied from there to the sysroot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it looks like all the remaining sysroot components are already built somewhere else and then copied to sysroot directory.
Updated with suggestion from #39892 (comment) |
@bors: r+ Looks great! |
📌 Commit 0c4c6fd has been approved by |
Fix test caching on Windows/GNU Addresses rust-lang#36385 (comment) Previously the sysroot directory was purged on every build and mingw startup objects were rebuilt unconditionally and always triggered test reruns. Now the sysroot directory is reused and mingw startup objects are rebuilt only when necessary, so test caching works.
Fix test caching on Windows/GNU Addresses rust-lang#36385 (comment) Previously the sysroot directory was purged on every build and mingw startup objects were rebuilt unconditionally and always triggered test reruns. Now the sysroot directory is reused and mingw startup objects are rebuilt only when necessary, so test caching works.
Fix test caching on Windows/GNU Addresses rust-lang#36385 (comment) Previously the sysroot directory was purged on every build and mingw startup objects were rebuilt unconditionally and always triggered test reruns. Now the sysroot directory is reused and mingw startup objects are rebuilt only when necessary, so test caching works.
Fix test caching on Windows/GNU Addresses #36385 (comment) Previously the sysroot directory was purged on every build and mingw startup objects were rebuilt unconditionally and always triggered test reruns. Now mingw startup objects are built in the native directory and then copied into the sysroot directory. They are also rebuilt only when necessary, so test caching works.
Fix test caching on Windows/GNU Addresses rust-lang#36385 (comment) Previously the sysroot directory was purged on every build and mingw startup objects were rebuilt unconditionally and always triggered test reruns. Now mingw startup objects are built in the native directory and then copied into the sysroot directory. They are also rebuilt only when necessary, so test caching works.
☀️ Test successful - status-appveyor, status-travis |
Addresses #36385 (comment)
Previously the sysroot directory was purged on every build and mingw startup objects were rebuilt unconditionally and always triggered test reruns.
Now mingw startup objects are built in the native directory and then copied into the sysroot directory. They are also rebuilt only when necessary, so test caching works.