universal: Can't reconcile two non-macho files
In macOS 12.3, Apple removed Python 2. electron-builder v23.0.0 added Python 3 support to resolve the issue. However, electron-universal now fails to package the universal app.
Full Error Message:
• electron-builder version=23.0.0 os=21.4.0
• loaded configuration file=package.json ("build" field)
• loaded parent configuration file=/Users/me/razer-macos/node_modules/electron-webpack/out/electron-builder.js
• writing effective config file=dist/builder-effective-config.yaml
• executing node-gyp rebuild platform=darwin arch=x64
• packaging platform=darwin arch=x64 electron=12.2.3 appOutDir=dist/mac-universal--x64
• executing node-gyp rebuild platform=darwin arch=arm64
• packaging platform=darwin arch=arm64 electron=12.2.3 appOutDir=dist/mac-universal--arm64
• packaging platform=darwin arch=universal electron=12.2.3 appOutDir=dist/mac-universal
⨯ Can't reconcile two non-macho files build/Makefile failedTask=build stackTrace=Error: Can't reconcile two non-macho files build/Makefile
at Object.exports.mergeASARs (/Users/BobWhite/razer-macos/node_modules/@electron/universal/src/asar-utils.ts:151:13)
at exports.makeUniversalApp (/Users/BobWhite/razer-macos/node_modules/@electron/universal/src/index.ts:200:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at MacPackager.doPack (/Users/BobWhite/razer-macos/node_modules/app-builder-lib/src/macPackager.ts:125:9)
at MacPackager.pack (/Users/BobWhite/razer-macos/node_modules/app-builder-lib/src/macPackager.ts:179:7)
at Packager.doBuild (/Users/BobWhite/razer-macos/node_modules/app-builder-lib/src/packager.ts:441:9)
at Object.executeFinally (/Users/BobWhite/razer-macos/node_modules/builder-util/src/promise.ts:12:14)
at Packager._build (/Users/BobWhite/razer-macos/node_modules/app-builder-lib/src/packager.ts:376:31)
at Packager.build (/Users/BobWhite/razer-macos/node_modules/app-builder-lib/src/packager.ts:337:12)
at Object.executeFinally (/Users/BobWhite/razer-macos/node_modules/builder-util/src/promise.ts:12:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
./dist/mac-universal/Razer macOS.app: No such file or directory
Does electron-universal directly utilize Python 2?
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 5
- Comments: 33 (11 by maintainers)
Adding this to
filesinelectron-builderconfig fixes the problem for us:'!node_modules/**/*.{mk,a,o,h}'It basically ignores all the C/C++ build files from packaging
In this command from the logs above ☝️
Both paths for lipo are the same.
/private/var/folders/y5/pp8xq1qd1f78jth_11nsxndh0000gn/T/arm64-mw1MJx/node_modules/argon2/bin/darwin-arm64-113/argon2.nodeNote thearm64-113/argon2.nodein both/T/arm64-mw1MJxand/T/x64-BD57LDdirs This seems like a bug in electron/universal? Why islipobeing used on a single-arch file?Same with
usb-detection. The binary is already universal.For now, I have to stay with version 22.xx.xxx Python 2 (can be downloaded from here: https://www.python.org/downloads/release/python-2718/)
Don’t forget to tell electron-builder where to find it using the
PYTHON_PATHVariable:Edit 1: it also works with electron-builder v23, as long as you set
"mergeASARs": false. However, I’d really like to merge asars…Edit 2: The binary of
usb-detectionis not in mach-o format. That is why it does not work. That means, it’s not a bug ofelectron/universalbut rather of usb-detection.Edit 3: It seems like the binary is in Mach-O format, but already contains both architectures:
Seems like
electron/universalcan’t process those binaries?@oltreseba you might need to exclude everything from
"!**/node_modules/better-sqlite3/build/**" and add back the"node_modules/better-sqlite3/build/Release/better_sqlite3.node",. Even without merging ASARs you really don’t want to have these extra files around because they could take a lot of space.Can confirm the same issue with
node-mac-permissionswith a small difference.First trip up is on
node_modules/node-mac-permissions/node-addon-api/nothing.target.mk