setup: retain older builder files that may still be in use #514

Closed
monsterlag wants to merge 4 commits from fix/retain-installed-builders into main
monsterlag commented 2026-11-08 07:36:58 +00:00 (Migrated from github.com)

Problem and behavior

Disk-space tradeoff: setup retains older installed, legacy and partial version folders instead of automatically deleting them. They can accumulate across updates. Obsolete downloaded ZIP parts are still removed; current/previous version bookkeeping is unchanged.

A build started by version A can still need its scripts or headers after versions B and C are launched. Windows may lock A's GUI executable while permitting its other files to be deleted. GUI/PID tracking cannot reliably account for older builders or orphaned children. Remove only automatic cross-version payload deletion, avoiding those lifetime assumptions.

Related to #493. This does not establish the cause of its reported repeated downloads or ROM copies.

Checks

  • The fixture compiles the actual production prune, rmtree, read_small and write_small bodies. Every filesystem target is an authored temporary directory, verified before execution and recursive cleanup; no real setup or installed builder is executed.
  • Windows/GNU: the original helpers fail all three payload-preservation checks; fixed helpers pass all five tests. Cases cover a real handle denying deletion sharing, unlocked headers/scripts, orphaned/legacy/partial payloads, bytes and attributes, and two native pruners released together through a Win32 event barrier.
  • Windows/MSVC: all five tests also pass with /W4 /WX. Fixture compiler/native children use CREATE_NO_WINDOW and BelowNormal priority.
  • Separate assertions preserve current/previous bookkeeping and ZIP-cache cleanup. Production setup.c also compiles as a complete translation unit without linking or running an installer.
  • All 47 existing CI steps remain unchanged; add a Windows native-fixture step. Include only the proven #488 fixture dependency. Linux skips this Windows-specific fixture; no Linux runtime validation is claimed.

Limits

Same-tag installation/Repair replacement remains unchanged and outside this fix, including its existing removal calls. There is no new cleanup UI, active-process lease or configurable retention policy. ZIP-cache cleanup remains unchanged; this does not make all concurrent installer operations safe. All four hosted checks passed at 17cb8e1, including the Windows MSVC fixture; no real installer, GUI or game was run.

## Problem and behavior **Disk-space tradeoff: setup retains older installed, legacy and partial version folders instead of automatically deleting them. They can accumulate across updates.** Obsolete downloaded ZIP parts are still removed; current/previous version bookkeeping is unchanged. A build started by version A can still need its scripts or headers after versions B and C are launched. Windows may lock A's GUI executable while permitting its other files to be deleted. GUI/PID tracking cannot reliably account for older builders or orphaned children. Remove only automatic cross-version payload deletion, avoiding those lifetime assumptions. Related to #493. This does not establish the cause of its reported repeated downloads or ROM copies. ## Checks - The fixture compiles the actual production `prune`, `rmtree`, `read_small` and `write_small` bodies. Every filesystem target is an authored temporary directory, verified before execution and recursive cleanup; no real setup or installed builder is executed. - Windows/GNU: the original helpers fail all three payload-preservation checks; fixed helpers pass all five tests. Cases cover a real handle denying deletion sharing, unlocked headers/scripts, orphaned/legacy/partial payloads, bytes and attributes, and two native pruners released together through a Win32 event barrier. - Windows/MSVC: all five tests also pass with `/W4 /WX`. Fixture compiler/native children use `CREATE_NO_WINDOW` and BelowNormal priority. - Separate assertions preserve current/previous bookkeeping and ZIP-cache cleanup. Production `setup.c` also compiles as a complete translation unit without linking or running an installer. - All 47 existing CI steps remain unchanged; add a Windows native-fixture step. Include only the proven #488 fixture dependency. Linux skips this Windows-specific fixture; no Linux runtime validation is claimed. ## Limits Same-tag installation/Repair replacement remains unchanged and outside this fix, including its existing removal calls. There is no new cleanup UI, active-process lease or configurable retention policy. ZIP-cache cleanup remains unchanged; this does not make all concurrent installer operations safe. All four hosted checks passed at `17cb8e1`, including the Windows MSVC fixture; no real installer, GUI or game was run.
NotRexed commented 2026-11-08 10:21:32 +00:00 (Migrated from github.com)

Thanks. Holding this one for now: keeping every installed version means each release adds a full builder folder that never goes away (hundreds of MB each over time). The case it guards against (an older build still running from a version the setup prunes) is handled on main now from the other side: a new build first stops a leftover build on the same work folder (14223cb, issues 501/530), and the setup keeps the current and previous version. If you still see a removed version in use after the next release, a log would help, and a narrower rule (keep a version while a process runs from it) would be welcome.

Thanks. Holding this one for now: keeping every installed version means each release adds a full builder folder that never goes away (hundreds of MB each over time). The case it guards against (an older build still running from a version the setup prunes) is handled on main now from the other side: a new build first stops a leftover build on the same work folder (14223cb, issues 501/530), and the setup keeps the current and previous version. If you still see a removed version in use after the next release, a log would help, and a narrower rule (keep a version while a process runs from it) would be welcome.
NotRexed commented 2026-11-09 05:29:38 +00:00 (Migrated from github.com)

Thanks! As discussed earlier, keeping every installed builder version was put on hold (each release would add a full folder that never goes away), and the branch now conflicts. Closing to keep the queue clear; a narrower rule (keep a version only while a process runs from it) would be welcome as a new PR.

Thanks! As discussed earlier, keeping every installed builder version was put on hold (each release would add a full folder that never goes away), and the branch now conflicts. Closing to keep the queue clear; a narrower rule (keep a version only while a process runs from it) would be welcome as a new PR.
Commenting is not possible because the repository is archived.
No description provided.