Files
OrcaSlicer/.github
HanifKohandLam Wei Lun 541ff1da58 Prune the Cached Preset JSONs Once for All Windows Targets (#16926)
* Prune the Cached Preset JSONs Once for All Windows Targets

build_preset_cache.bat pruned each target on its own, reading every
vendor's preset list from the checkout's <vendor>.json. CI names the
checkout as the first target, and pruning it deletes those files, so the
install tree that the portable zip and the MSIX are packed from only
lost the 71 vendor JSONs and kept all 14,600 preset JSONs next to the
caches. The prune also started one PowerShell per vendor and deleted
file by file, which took 28 minutes on the Windows arm64 runner against
under a minute on x64, and set the wall clock of every PR.

The pruning moves to prune_cached_presets.ps1, run once for all targets:
it reads every vendor profile before touching any target and deletes in
a single process, printing how long each target took. The batch script
only validates the targets, installs the caches and queues them.

A test suite exercises the script on a made-up profiles tree, including
the source-then-install-tree order CI uses, and runs in the Windows build
script tests job.

* Resolve the Prune Script Next to the Repo Root, Not %0

The prune label runs after the argument loop has shifted %0 along with
the rest, so %~dp0 named the last target's directory and PowerShell
could not find the script. REPO_ROOT was captured before any shift.

* Read the Preset List From the Target's Own Profile in the Shell Script

The shell script read each vendor's preset list from the source profiles,
which is gone once an earlier --prune-source target has been pruned. No
caller passes the source as a target today, so this is the same latent
dependency the batch file had, removed before it bites.

Ported from https://github.com/OrcaSlicer/OrcaSlicer/pull/16975.

---------

Co-authored-by: Lam Wei Lun <weilun.lam@gmail.com>
2026-10-28 22:11:34 +08:00
..
2025-01-07 22:58:29 +08:00
2024-07-09 21:06:06 +08:00
2026-09-07 12:14:05 +08:00