Skip to content

Commit 7a526ca

Browse files
committed
Auto merge of #39052 - alexcrichton:fix-rebuild, r=brson
rustbuild: Skip the build_helper crate in tests I've been noticing some spurious recompiles of the final stage on Travis lately and in debugging them I found a case where we were a little to eager to update a stamp file due to the build_helper library being introduced during the testing phase. Part of the rustbuild system detects when libstd is recompiled and automatically cleans out future directories to ensure that dirtyness propagation works. To do this rustbuild doesn't know the artifact name of the standard library so it just probes everything in the target directory, looking to see if anything changed. The problem here happened where: * First, rustbuild would compile everything (a normal build) * Next, rustbuild would run all tests * During testing, the libbuild_helper library was introduced into the target directory, making it look like a change happened because a file is newer than the newest was before * Detecting a change, the next compilation would then cause rustbuild to clean out old artifacts and recompile everything again. This commit fixes this problem by correcting rustbuild to just not test the build_helper crate at all. This crate doesn't have any unit tests, nor is it intended to. That way the target directories should stay the same throughout testing after a previous build.
2 parents d274e55 + 36a926a commit 7a526ca

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/bootstrap/check.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,16 @@ pub fn krate(build: &Build,
373373
let mut visited = HashSet::new();
374374
let mut next = vec![root];
375375
while let Some(name) = next.pop() {
376-
// Right now jemalloc is our only target-specific crate in the sense
377-
// that it's not present on all platforms. Custom skip it here for now,
378-
// but if we add more this probably wants to get more generalized.
379-
if !name.contains("jemalloc") {
376+
// Right now jemalloc is our only target-specific crate in the
377+
// sense that it's not present on all platforms. Custom skip it
378+
// here for now, but if we add more this probably wants to get
379+
// more generalized.
380+
//
381+
// Also skip `build_helper` as it's not compiled normally for
382+
// target during the bootstrap and it's just meant to be a
383+
// helper crate, not tested. If it leaks through then it ends up
384+
// messing with various mtime calculations and such.
385+
if !name.contains("jemalloc") && name != "build_helper" {
380386
cargo.arg("-p").arg(name);
381387
}
382388
for dep in build.crates[name].deps.iter() {

0 commit comments

Comments
 (0)