Repository navigation
Mac app: skip the exFAT "._" files that break the pack (patch 0056) - #487
lucaszhongsj wants to merge 2 commits into
Conversation
Patch 0056. On a volume without native extended attributes (exFAT, an external drive for the build folder or the app) every file's attributes live in a "._name" file beside it. The input globs take those for modules, shaders and fonts, the copies carry them into the bundle, and codesign reads the one beside the launcher as a code object that is not signed, so the whole pack fails. Fixes LNPANDY#486.
|
Thanks for the fix and for the three failures you traced. Engine changes go to seedds/nxnative first, as |
|
Forwarded: seedds/nxnative#991 — patch 0056 now says That upstream PR carries the same change plus the reference entry in Understood on the number — I will not chase it. |
|
Thanks @lucaszhongsj, and thanks for forwarding it as seedds/nxnative#991. I carry your commit into the next patch number in a new stack for v1.0.2, with you as author. When that PR is up I close this one with a link. The patch drops on the next engine bump once upstream has #991. |
|
Thanks @lucaszhongsj. Your commit is in |
Fix or feature
What and why
Fixes #486.
dm/mac/pack_app.pybreaks when the build folder or the app is on exFAT, which is what an external drive gives you when the internal one cannot hold an 8 GB RomFS and a 19 GB app per game. exFAT has no native extended attributes, so macOS keeps each file's xattrs in an AppleDouble file named._<name>beside it, and the pack trips over them three times:MODULE_FILES,MSL_FILES,PSO_FILES,*.ttf) match._main.patched.binand._..._b.metallibas if they were modules and shaders —no rewriter fixups for .../._main.patched.bin, laterno input file at .../._1785f88868f76e74_b.metallib;shutil.copy2of the host cannot set the flags of the copy (chflags: Operation not permitted), andcp -Rcarries the sidecars into the bundle (DMModuleFilesin the builtInfo.plistlisted 18._*entries);codesignreadsContents/MacOS/._nxnativeas a nested code object that is not signed and refuses the whole bundle:code object is not signed at all.The patch (0056) does three things: it drops those names from the input globs; it copies without extended attributes (
cp -Xwhere it is not cloning,shutil.copyinstead ofcopy2for the host) so a copy no longer creates them; and it strips what a copy or the compiler still leaves from the staged bundle beforecodesignreads it, retrying once with the attributes cleared, and strips again after signing because codesign sets an attribute on what it signs.On APFS nothing changes: no
._file exists there,cp -cstill clones, and the twostrip_detrituswalks are a stat pass over the staged tree.Checked
python3 tools/engine.py check— patch queue ok, 35 patches apply cleanly tocd859c38a8f8. The engine'sdm/tools/tests/test_nsp_mac_app.py— 45 tests pass, including the newtest_finder_detritus_is_not_an_input_and_never_reaches_the_bundle(a._file in every input folder is not selected, does not reach the bundle, and is not listed inDMModuleFiles).no input file at .../._1785f88868f76e74_b.metallibnow completes withstep: signing (ad-hoc)andapp: /Volumes/Fridge/01008CF01BAAC000.app,codesign --verify --strictpasses and the bundle holds no._file. The same pack against the same inputs with the unpatched script fails in all three places above.Not checked: the game was not played from that app for this patch, and no iPhone target was built.
Screenshots
None, no visible change.
Scope
dm/,scripts/,docs/,ref/) is added to the repository: a change there is a patch inpatches/(a commit inengine/, thentools/engine.py export, andtools/engine.py checkpasses), with itsUpstream-Statusforwarded seedds/nxnative#..., orpendinguntil that PR is openThe patch says
Upstream-Status: pending: I have no fork ofseedds/nxnativeto open that pull request from. Could a maintainer forward it, or tell me where to send it?