feat: add nonBinaryFilesToIgnore to allow per-arch non-binary files#208
Open
sgraczyk wants to merge 2 commits into
Open
feat: add nonBinaryFilesToIgnore to allow per-arch non-binary files#208sgraczyk wants to merge 2 commits into
sgraczyk wants to merge 2 commits into
Conversation
macOS 26 Icon Composer .icon files are compiled by actool into Assets.car with per-compilation UUIDs and a per-build timestamp, so the x64 and arm64 catalogs are never byte-identical and makeUniversalApp aborts on the PLAIN-file SHA check (only MainMenu.nib is currently exempted). Add a nonBinaryFilesToIgnore minimatch option (matched via the existing matchGlob helper, like x64ArchFiles/infoPlistsToIgnore). Matching files may differ across arches; the x64 copy is kept in the universal app. Refs electron#148, electron/packager#1843.
Assert the universal merge throws on a differing non-binary file (Assets.car) by default, and keeps the x64 copy when the path is matched by nonBinaryFilesToIgnore.
MarshallOfSound
requested changes
Jun 25, 2026
MarshallOfSound
left a comment
Member
There was a problem hiding this comment.
Let's fix this in packager by only running actool once for multiple arches.
Instead of adding to this modules config explosion
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.
Summary
Adds a
nonBinaryFilesToIgnoreminimatch option tomakeUniversalApp. When a non-binary (PLAIN) file's contents differ between the x64 and arm64 builds and its path matches the pattern, the mismatch is allowed and the x64 copy is kept, mirroring the existing hardcodedMainMenu.nibcarve-out, but configurable.Motivation
macOS 26 "Icon Composer"
.iconapp icons are compiled byactoolintoContents/Resources/Assets.car. Tools like@electron/packagerrunactoolonce per architecture, and its output is not byte-reproducible — it embeds per-compilation UUIDs in the catalog image names and a per-build timestamp in the.carheader. So the x64 and arm64Assets.carare never identical, andmakeUniversalAppaborts with:This is reported in #148 and electron/packager#1843. There is currently no escape hatch for non-binary files:
singleArchFilesis ASAR-scoped andx64ArchFilesis gated inside the Mach-O loop, so neither can exemptAssets.car. The only existing exception is the hardcodedMainMenu.nibcase.electron-builder hit the same root cause and fixed it (electron-userland/electron-builder#9279) by compiling the catalog once and copying the x64
Assets.carover the arm64 copy before stitching. This PR offers the counterpart on the@electron/universalside: an opt-in allowlist for non-binary files that are deterministic in effect but not byte-identical. Consumers reach it through@electron/packagerviapackagerConfig.osxUniversal.nonBinaryFilesToIgnore.Usage
Notes
MainMenu.nibbehavior.matchGlobhelper, likex64ArchFiles/infoPlistsToIgnore. The new option is documented via JSDoc onMakeUniversalOpts.MainMenu.nibpath — pointers to the preferred fixture pattern welcome.Refs #148, electron/packager#1843.