Skip to content

fix(build): --clean must verify the deletion, and run it through bash - #83

Merged
alderpath merged 1 commit into
mainfrom
fix/cleanup-verify
Nov 25, 2026
Merged

alderpath merged 1 commit into
mainfrom
fix/cleanup-verify

Conversation

@alderpath

Copy link
Copy Markdown
Collaborator

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 rm never 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 no mutants.out directory present even the target deletion was skipped, and 2>/dev/null || true printed cleaned. 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. --clean now asserts target is gone, exits 6 if not, counts leftover scratch dirs, and prints the free-space delta.

Measured after the fix

>> cleaned remote target/ and scratch dirs (0 scratch dirs left)
>> john@100.74.133.54 free after: 250G

/var/tmp went 207 G to 250 G free, ocserve-build is 201 MB (source only), and the 2,782 leftover ocserve-* test scratch directories are gone.

Script-only; no product code.

…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.
@alderpath
alderpath merged commit 1579a6f into main Nov 25, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant