feat(builder): the profile's mods' ExeFS patches are built in, and a start builds again when they change #2607
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2607
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:feat/mods-exefs-rebuild"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Mods' ExeFS patches (
.ips,.pchtxt) never reach the game with the Rust builder. Two stubs were left for the Mod API (#2434):build_driver::read::manifest_modsalways returned no mods, so a build applied no patch.The game's Mods tab keeps saying "1 ExeFS patch file is not in the game yet: build the game again".
This fills both:
manifest_modsfinds the profile's manifest mods the way the game does (game/mods.c,docs/dev/reference/mods.md"Discovery and order"):mod.jsonone to four levels belowmods/, and nothing below a mod is searched;-…or_…are off, along with everything below them, and.…folders are skipped;mods/, which is the name the game looks for inexefs_patches.txt;mods.json: the mods it names first, then the others, on, sorted by path ignoring case.Stamp.patches(play::patches_stamp) is a hash of each enabled mod's patch files: their names and SHA-256s, in order. It's recorded with each build. When it differs at a start, the game is built again (Stale::Mods) in the same game folder. Only the functions the patches change are lifted and compiled again.mods_stamp, which names a separate game folder per code-mod set, stays the Mod API's.Testing
Tested (Linux, RTX 3090, this branch's
longshot-builder, all through the job queue):cargo clippy -p build-driver --all-targets -D warningsis clean.manifest_mods_are_found_and_ordered_as_the_game_does(no profile and no mods folder give none; four levels down found, five not; nothing below a mod;-/_/.folders skipped;mods.jsonorder first withenabled: falsekept as off, unknown and non-local/ids ignored, the rest on and after by path ignoring case; a badmods.jsonleaves every mod on) andpatches_stamp_follows_the_enabled_mods_patch_files(empty with no patches; ignores files other than .ips/.pchtxt; changes when a patch's bytes change, when the order changes and when a mod is switched off).update --profileandinfo --profile --output jsonbetween steps:exefs/test.pchtxt(a write of the bytes already there): stale, "the mods that need a build changed". The update took 6 s, 0 of 906 units compiled again;exefs_patches.txtlistspatchtest test.pchtxt ... empty; up to date after it.mods.json: stale again with the same reason. The update took 5 s and the mod's line leftexefs_patches.txt; up to date after it.Still to test:
code): only the units it touches are lifted and compiled again.Measurements
Nothing to measure yet: a rebuild after a patch change lifts and compiles only the functions the patches touch.
Risks
Builds made before this record no
patcheskey, so they read as empty: a profile with no ExeFS mods doesn't rebuild. A profile that already has some rebuilds once at its next start. Revert to undo.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (this PR's CI runs it)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (to add)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8e1RP1VgcWpgA7Kq6ec
Possibly related, for context:
Builder end-to-end test of this branch (
27e770ebplus the tests commit; Linux, RTX 3090, job queue). The game folder was a copy of a main base build, driven withlongshot-builder update --profileandinfo --profile --output json:infosaysexefs/test.pchtxt, a write of the bytes already there)exefs_patches.txt:patchtest test.pchtxt ... emptymods.jsonexefs_patches.txtThe game wasn't started. The new unit tests for
manifest_modsandpatches_stamppass. A patch of kindcode, which would lift and compile units again, wasn't tried.WIP: feat(builder): the profile's mods' ExeFS patches are built in, and a start builds again when they changeto feat(builder): the profile's mods' ExeFS patches are built in, and a start builds again when they change