Fix cross-PR contamination by cleaning after checkout #2832
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 should fix #396 - see my analysis there.
I initially wanted to annihilate the entire workspace with
workspace: clean: all. While I believe that would be effective and simpler to reason about (making reused machines perform completely fresh clones), it would be slower when machines are reused. Even though the actual time savings are rather small (~15 seconds), the total machine time across many VMs is more significant.This uses
git clean --quiet -x -d -f -fwith two force options because we want to clean up any leftover submodules; git will refuse to do that if there's only one force option. (--quietsuppresses potentially voluminous log output which we aren't interested in.)This also makes a vaguely related change to the submodule checkout scripts. They now use two force options for consistency (even though we aren't worried about nested submodules), and this changes boost-math to follow llvm-project's commands more closely. It replaces
git checkout -f FETCH_HEADwithgit reset --quiet --hard FETCH_HEAD; they have the same effect, but the latter avoids emitting the "detached HEAD" warning. It also adds acleancommand.