Repository navigation
The Mac app pack ignores the AppleDouble files of an exFAT drive - #991
Closed
lucaszhongsj wants to merge 1 commit into
Closed
lucaszhongsj wants to merge 1 commit into
lucaszhongsj wants to merge 1 commit into
Conversation
With the build folder or the app on an exFAT or FAT drive, pack_app.py took
"._name" files for modules and shaders ("no input file at
.../._<key>_b.metallib", "no rewriter fixups for .../._main.patched.bin"),
copy2 could not set the copy's flags ("chflags: Operation not permitted"),
and codesign read "Contents/MacOS/._nxnative" as a nested code object that
is not signed, which failed the whole bundle.
Such a file system keeps each file's attributes in a "._name" file beside
it. The input globs now skip those names, the copies carry no attributes
("-X" where cp copies, and shutil.copy for the host), and the staged
bundle is stripped before codesign reads it, again after "xattr -cr" when
it still refuses one, and once more after signing, which creates one by
itself.
Checked on an exFAT disk image made with "hdiutil create -fs ExFAT": the
same inputs pack, sign and pass "codesign --verify --strict", and the
script without the change stops in each of the three places.
dm/tools/tests/test_nsp_mac_app.py covers a "._" file in every input
folder, out of the selection, out of the bundle and out of DMModuleFiles.
lucaszhongsj
added a commit
to lucaszhongsj/NX2Apple
that referenced
this pull request
Nov 2, 2026
4 of 6 tasks
Dino0005
pushed a commit
to Dino0005/NX2Apple
that referenced
this pull request
Nov 2, 2026
Marceloalexandregoncalves
pushed a commit
to Marceloalexandregoncalves/nxnative
that referenced
this pull request
Nov 3, 2026
On a volume without native extended attributes (exFAT, the build folder or the output on an external drive) each file's attributes live in a "._name" file beside it, which breaks the pack four ways: the input globs take those names for modules, shaders and fonts and the fixups check fails on one, copystat cannot set the flags of a copy (chflags: Operation not permitted), a recursive copy carries the sidecars into the app, and codesign reads the one beside the launcher as a code object that is not signed and refuses the whole bundle: "code object is not signed at all", In subcomponent. Skip them in the globs, copy without extended attributes (-X, cp rejects it together with -c) and with shutil.copy instead of copy2 for the host, and strip what a copy or the compiler leaves from the staged bundle before codesign reads it, retrying with the attributes cleared if it refuses one. Strip again afterwards: codesign sets an attribute on what it signs. Upstream-Status: forwarded seedds#991 Reason: a build folder or an app on exFAT keeps every file's attributes in a ._name file beside it: the inputs, the copies and codesign all break on them (issue seedds#486) Issue: LNPANDY/NX2Apple#486
seedds
added a commit
that referenced
this pull request
Nov 3, 2026
… inputs skip "._name" files, copies leave extended attributes out, and the bundle is stripped of them before codesign reads it (#991) Co-authored-by: lucaszhongsj <[email protected]>
Owner
|
Landed on main as 998896a, with you credited as co-author. |
Know-It-All-Brother
pushed a commit
to Know-It-All-Brother/nxnative
that referenced
this pull request
Nov 9, 2026
… inputs skip "._name" files, copies leave extended attributes out, and the bundle is stripped of them before codesign reads it (seedds#991) Co-authored-by: lucaszhongsj <[email protected]>
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.
What and why
pack_app.pybreaks when the build folder or the app is on exFAT or FAT, 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.Such a file system has no extended attributes, so macOS keeps each file's attributes in an AppleDouble file
._<name>beside it. That is the same thing #476 met inscan_nspsand #555 in the shader build, and the pack trips over it three times:selected_inputsglobs take._main.patched.binand._<key>_b.metallibfor modules and shaders, so the build stops withno rewriter fixups for …/._main.patched.binorno input file at …/._<key>_b.metallib;shutil.copy2of the host cannot set the copy's flags (chflags: Operation not permitted), andcp -Rcarries a folder's sidecars into the bundle, whereDMModuleFileslists them;codesignreadsContents/MacOS/._nxnativeas a nested code object that is not signed and refuses the whole bundle (code object is not signed at all), which is the report that reads like a broken launcher build.The change skips those names in the input globs, copies without extended attributes (
-Xwherecpcopies,shutil.copyfor the host), and strips what a copy or the compiler leaves from the staged bundle beforecodesignreads it, retrying once with the attributes cleared when it still refuses one, and once more after signing, because signing sets an attribute on what it signs. On APFS nothing changes: no sidecar exists there and both passes are a stat walk over the staged tree.The finding is in docs/reference/packing.md, under "External drives", and
docs_symptoms.pywas run.The same change is carried in NX2Apple as a patch for now, with LNPANDY/NX2Apple#486 and LNPANDY/NX2Apple#487 as the report and the fork-side pull request.
Checked
dm/tools/tests/test_nsp_mac_app.py— 45 tests pass on this branch, including the newtest_finder_detritus_is_not_an_input_and_never_reaches_the_bundle, which puts a._file in every input folder and checks that it is not selected, does not reach the bundle and is not inDMModuleFiles.python3 dm/tools/docs_symptoms.pyreports 717 symptoms and its only change is the new line.01008CF01BAAC000, update 1.1.0 (v196608), packed on an exFAT USB volume. Before the change the step stops atno input file at …/._1785f88868f76e74_b.metallib, after it the same inputs pack, sign ad hoc, and the bundle passescodesign --verify --strictwith no._file left in it.hdiutil create -fs ExFAT) with stand-in inputs, where the script without the change stops in each of the three places and the one with it succeeds.scripts/regress.py— no chain tool, no host code and no tool every game uses is touched, so nothing under the shader chain changes.Docs
docs/reference/packing.mdentry, andpython3 dm/tools/docs_symptoms.pywas run (the symptom index)dmsh_chain.py --headerwas run anddm/gfx/nvn/dmsh_chain.his part of the change