Create work/image before the standalone lift saves its chunk boundaries #1947
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!1947
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/lift-standalone-image-folder"
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?
The documented source-build steps run
python -I nx2/lift.py --standalone --writeon a fresh checkout, and on a newwork/folder that command translates the whole game and then stops at its last step:The chunk boundaries are saved under
<work>/imagewhile the image itself goes to<work>/sa/image, and onlymake_game.pymade the first folder. Anyone following docs/development.md without the builder hits it after ~10 minutes of translation.What changed
nx2/chunks.py:save()makes the folder it writeschunks.txtinto, so every caller can save into a folder that does not exist yet.tests/test_chunks_save_folder.py: saves into a missing<work>/image, reads the boundaries back, and saves again to check the file is replaced rather than appended.How it was tested
FileNotFoundErrorabove after translating 294,523 functions.work/imageremoved and the same command re-run: exit 0 after 512 s, 294,523 functions, 17,646,456 instructions, 100.0000% translated, andwork/image/chunks.txtwritten (75 code files).build.py --standalone --jobs 8compiled 465 files with 0 failures; the game ran on Vulkan (RTX 3080 Laptop, driver 32.0.15.9159) from the title screen through the intro to Kokiri Forest at 60 fps in the light scenes.python -I -B tests/run_all.pyon this branch: 313 passed, 21 skipped; the checks that failed under 8-way load time out on fixture compiles on this PC and pass when run alone (verified for four of them).No issue to link; found while building the game from source on Windows.
Looks good. The one call to
chunks.save(viachunks.write,lift.pyline ~184) passes<work>/image, which nothing creates on a standalone lift, so theos.makedirs(img_dir, exist_ok=True)insave()is the right place to fix it: every caller is covered, and it is a no-op whenmake_game.pyalready made the folder.The test follows the
test_chunk_split.pyconventions (kitimport,python -I -Bheader), needs no dump, and checks both the missing-folder case and that a second save replaces the file.run_all.pydiscoverstests/test_*.py, so no registration is needed.No prior discussion on the PR. No CI checks are reported for the branch, so I only read the diff; I did not build or run it. The lift and in-game runs in the description are consistent with the change.