fix: re-apply #360 with fix for recursive backup directory accumulation #369
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.
Summary
This PR re-applies #360 (monorepo cache isolation) and fixes the bug that
caused it to be reverted in #364.
Why?
In the implementation of #360, users on self-hosted runners reported that
mise-bin-backup-*directories were nesting recursively inside thebin/folder, causing exponential disk growth (75GB in 20 hours).
The bug was in
withBinaryBackup(): when usingio.cp()to restore thebackup directory to an existing destination, it copies the source INTO the
destination rather than replacing it. This created nested directories that
got backed up on subsequent runs, compounding the problem.
See: #363
How?
entire
bin/directory. This avoids theio.cpdirectory behavior entirely.mise-binary-backup-*to distinguish from oldcontaminated backups.
bin/contains only the mise binary after multiplecache restore cycles.
Fixes #363
Related to #360
Previously Reverted in #364
Co-authored-by: Florian Fittschen ffittschen@gmail.com