Repository navigation
fix(build): full rebuilds skip unchanged asset work (~15 min → ~24 s on Windows, faster on Linux too), and dist/ keeps its asset cache - #218
Merged
Conversation
…finishes The asset tasks exec'd tools/bin/asset_processor without .exe and by a relative path xmake doesn't resolve on Windows; use an absolute path with the .exe suffix. build.py no longer raises UnicodeEncodeError when stdout is redirected (cp1252). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sset cache Fingerprint the asset tasks' inputs (ROM SHA1, assets/*.json, asset tool sources) so code-only full builds skip extract/convert/build; force re-extraction when inputs change; keep assets/<region>/ caches when staging dist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Files:
build.py,xmake.luaWhat this helps with
Anyone running the full (non-slim)
build.pymore than once: contributors iterating on code, testing a packageddist/build, or checking asset or mod changes against a real install. Today each full build repeats about 15 minutes of asset work on Windows, then the next launch ofdist/repeats the runtime extraction too. After this PR, a code-change full build takes 24 s anddist/launches straight into the game. The skip check is broken on every platform, so Linux full builds also stop redoing the whole extract/convert/build pass. Slim builds and release CI are unaffected.Cause
build_version()requiresbuild/<version>/assets_src, which none of the asset tasks create, so every run redoes ~21k extractions and ~10k conversions.rmtreesdist/<version>/assets, deleting tmc_pc'sassets/<region>/cache, so the next launch re-extracts.Change
assets/*.json, sources ofasset_processorand its converters) intobuild/<version>/.assets_fingerprintafterBuild assetssucceeds, and skip the tasks when it matches.TMC_ASSET_FORCE_EXTRACT=1→asset_processor -f). Extraction otherwise skips files that already exist, so a stale or corrupted file (like the dungeon maps from fix(asset tools, Windows): write dungeon maps in binary mode ("w"→"wb"); Windows text mode shifted 462 map offsets #214's bug) would survive. With perf(asset tools): full asset pass ~23 min → ~17 s on Windows (all cores, nocmd.exe, in-processgbagfx/aif2pcm) #216 a forced extract takes ~4 s.assets/<region>/andassets_src/<region>/, the way it already keepsassets/rando/.Why it's safe
.asset_build_state.json..assets_fingerprint(build) ordist/<version>/assets/<region>/(runtime).Note on #210
#210 also adds a function to
build.pyat the same spot (stage_voxel_shapes, afterstage_rando_logic). Whichever merges second gets a trivial conflict: keep both functions. Everything else in this PR merges cleanly with #210.Tested (Windows, USA)
Assets up to date ... skipping, ~15 min → 24–27 s.dist/USA/assets/usa/.asset_build_state.jsonkeeps its timestamp, and launch goes straight topaks mounted.Entering AgbMain.... Play-tested to the Picori Festival (early game only).Developed with assistance from Claude Code (Opus 5.5). I reviewed and tested the changes as described above.