Skip to content

Conversation

@chadxz
Copy link
Contributor

@chadxz chadxz commented Jan 28, 2026

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 the bin/
folder, causing exponential disk growth (75GB in 20 hours).

The bug was in withBinaryBackup(): when using io.cp() to restore the
backup 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?

  • Applied fix from PR fix: Prevent recursive backup directories in withBinaryBackup #366: backup only the mise binary file itself, not the
    entire bin/ directory. This avoids the io.cp directory behavior entirely.
  • Renamed backup prefix to mise-binary-backup-* to distinguish from old
    contaminated backups.
  • Added tests that verify bin/ contains only the mise binary after multiple
    cache restore cycles.
  • Tested with act to confirm fix prevents accumulation.

Fixes #363
Related to #360
Previously Reverted in #364

Co-authored-by: Florian Fittschen ffittschen@gmail.com

chadxz and others added 2 commits January 27, 2026 20:20
Why?
====

In the implementation of jdx#360, users on self-hosted runners reported
that mise-bin-backup-* directories were nesting recursively inside
the bin/ folder, causing exponential disk growth (75GB in 20 hours).

The bug was in withBinaryBackup(): when using io.cp() to restore the
backup 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: jdx#363

How?
====

- Applied fix from PR jdx#366: backup only the mise binary file itself,
  not the entire bin/ directory. This avoids the io.cp directory
  behavior entirely.
- Renamed backup prefix to mise-binary-backup-* to distinguish from
  old contaminated backups.
- Added test workflow that verifies no nested backup directories
  appear after multiple cache restore cycles.
- Tested with act to confirm fix prevents accumulation.

----

Fixes jdx#363
Related to jdx#360
Reverted in jdx#364

Co-authored-by: Florian Fittschen <ffittschen@gmail.com>
@chadxz
Copy link
Contributor Author

chadxz commented Feb 4, 2026

Hi @jdx is this something you're interested in merging?

@jdx
Copy link
Owner

jdx commented Feb 4, 2026

not sure right now

@chadxz
Copy link
Contributor Author

chadxz commented Feb 4, 2026

np, I'll leave it for now. I'm running with this fork to address my issue so it's not time-sensitive.

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.

mise-action rapidly fills up temporary directory

2 participants