Repository navigation
fix(build): --clean must verify the deletion, and run it through bash - #83
Merged
Merged
Conversation
…s on globs) Two bugs, both of which made the cleanup report success over a 42 GB tree. 1. `rm -rf target mutants.out*` never ran. The remote login shell is fish, and fish aborts the entire command line when a glob matches nothing, so with no mutants directory even the target deletion was skipped — while `2>/dev/null || true` printed "cleaned". That is the swallowed-result class this repo bans. There is no glob now (find -exec) and everything runs through bash, which is what the other remote commands already do. 2. The command announced success instead of checking it. It now asserts `target` is GONE and exits 6 if not, prints how many scratch dirs remain, and reports the free-space delta. `--clean` on a real tree: 207G -> 250G, target gone, 0 scratch dirs left.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The cleanup I added for the off-host build rule was lying, and I only found it by checking the disk afterwards instead of trusting the message.
Two bugs
1. The
rmnever ran.rm -rf target mutants.out*goes to the remote's login shell, which is fish. Fish aborts the whole command line when a glob matches nothing, so with nomutants.outdirectory present even thetargetdeletion was skipped, and2>/dev/null || trueprintedcleaned. That is precisely the swallowed-result class this repo bans, in a script whose entire job is disk hygiene.2. It announced success instead of verifying it.
--cleannow assertstargetis gone, exits 6 if not, counts leftover scratch dirs, and prints the free-space delta.Measured after the fix
/var/tmpwent 207 G to 250 G free,ocserve-buildis 201 MB (source only), and the 2,782 leftoverocserve-*test scratch directories are gone.Script-only; no product code.