Repository navigation
Release: keep the bundled engine's binaries as built, so shader builds start - #353
Merged
Merged
Conversation
…s start The release re-signed every Mach-O file of Contents/Resources/engine with codesign --force --sign -. codesign rewrites the signature inside the file, and dm/gfx/tools/dmsh_chain.lock pins spirv-cross by the SHA-256 of its bytes, so every shader build from the bundled engine stopped with "translation chain tools do not match the lock file: spirv-cross" (own_compilers.py exit code 1). The 0.7.5 zip carries spirv-cross 494d7b19af07fbc3 while its own lock says e37945d8e441d34d. The upstream binaries are already signed (spirv-cross by the linker, the translator's apphost ad-hoc), which Apple silicon runs as they are. frontend/tools/sign_engine_tree.sh signs only a Mach-O file that has no signature, and its --check mode, run in the bundle check step, fails the release when an engine file differs from the zip asset's tree or spirv-cross does not match the lock. Co-Authored-By: Claude Opus 5.5 <[email protected]>
LNPANDY#355 skipped spirv-cross in the signing loop and added a cmp. sign_engine_tree.sh replaces that loop and checks every file of the bundle, so its side stays.
Collaborator
|
Hi @Dino0005, #355 changed the same lines in |
4 of 6 tasks
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.
Fix or feature
What and why
Symptom. With the engine the release bundles, every game build stops at the shader step:
Cause. "Assemble the bundle" in
build-mac-app.ymlre-signs every Mach-O file ofContents/Resources/enginewithcodesign --force --sign -. codesign rewrites the signature inside the file, anddm/gfx/tools/dmsh_chain.lockpins spirv-cross by the SHA-256 of its bytes (tool_lock.py), so the bundled spirv-cross no longer matches its own lock. The launcher copies that tree to~/Library/Application Support/NX2Apple/engine/<id>/, andown_compilers.pystops there. The released zip shows it:NX2Apple-macOS-arm64.zipengine/dm/gfx/tools/dmsh_chain.lock,spirv-crosslinee37945d8e441d34dengine/dm/gfx/tools/spirv_cross_bin/spirv-crossin the same zip494d7b19af07fbc3The translator's apphost (
dmsh_xlate) is re-signed the same way. The lock does not pin it, so it does no harm, but it is not the file the zip asset holds either.v0.8.0-rc1still has the loop (build-mac-app.ymlline 238), so 0.8.0 would ship the same tree.The upstream binaries are already signed: spirv-cross by the linker (
flags=0x20002(adhoc,linker-signed)) and the apphost ad-hoc (flags=0x2(adhoc)). Apple silicon runs them as they are, so the re-signing is not needed.Change.
frontend/tools/sign_engine_tree.sh, besidebundle_tools.shandcheck_bundle.sh. It signs only a Mach-O file of the engine tree that has no signature at all and leaves every other file as built. Then it checks that each file of the bundle's engine is byte for byte the tree's (or, when it had no signature, that it now verifies), that spirv-cross matchesdmsh_chain.lock, and that spirv-cross carries a signature.sign_engine_tree.sh --check, so a release whose engine differs from the zip asset's tree, or whose spirv-cross does not match the lock, fails before it is uploaded.Checked
sign_engine_tree.shon the real engine tree (c5fe6b5…, astools/engine.py treewrites it), on an Apple M3 Pro, macOS 27.2:changed in the bundle: dm/gfx/tools/spirv_cross_bin/spirv-crossandspirv-cross is 903cd20a04dad7b0, dmsh_chain.lock says e37945d8e441d34dcodesign -v --deep --stricton the bundle holds with the engine files left as builtown_compilers.py exit code 1passes the tool check and runs the shader steps.pre-pushhook's checks pass on this branch (main fc3baab).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 open🤖 Generated with Claude Code