fix(build): escape the build folder in glob patterns (a work folder with [ ] found no lifted code) #1722
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!1722
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/glob-escape-work-dir"
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?
What
A build folder (
--work, or the builder's Change for the build files) whose path contains[or]makes the lift fail. Example:D:\Ports\[NS2] Hookshot\work.The passes find the generated C with
glob.glob(os.path.join(gen, "code_*.c")).globreads the brackets in the folder's own path as a character class ([NS2]matches one ofN,S,2), so the pattern matches no file. Every text patch then reports "found 0 times", and the output size check stops the build. The lift itself is fine (100% translated).Change
The folder part goes through
glob.escape()in the five calls that build a pattern fromgen:nx2/chunks.py,nx2/oot_native_resolution.py,nx2/oot_patches.py(2) andnx2/split_hot.py. Thepathlib.glob()calls innx2/test_default_point_size.pyonly take relative patterns, so they're unaffected.Testing
Windows 11,
make_game.py --nup ... --work "D:\Ports\[NS2] Hookshot\work"with the builder's v2.0.12 tools:maind8f0513and on the v2.0.12 tag alike;oot_native_resolution: scene base scale (f_806702e0) in code_005.c,oot_patches: output size in code_008.c, ... the free and mouse cameras, text speed, dynamic resolution) and the build goes on to compiling.🤖 Generated with Claude Code