Fix rebuild_sub_package_then_while_package on HFS. #7865
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This test was flaky on HFS (azure failure), resulting in this error:
There are two race-condition bugs here.
Race 1: The second cargo build command (
cargo build -pb
) would sometimes not build, because it thoughtb
is fresh. This can happen when the first build finishes and changingb/src/lib.rs
happen within the same second. (#5918) The test silently ignored this failure, this is not the cause of the CI failure, though.Race 2: The first and second build commands work as expected. The third build command fails because it thinks both
a
andb
are "fresh". However,b
was just rebuilt, anda
depends on it, soa
should have been rebuilt. It thinksa
is fresh becausea
's mtime is equal tob
whenb
finishes compiling within the same second that the first build finished.The solution here is to make sure the second step happens well after the first. The underlying problem is #5918.