Universal build fails on non-ARM64 hardware, and M1 target DMG is 'damaged'
See original GitHub issueI’ve got an app which I build hosted in an Electron container, to give me some native/filesystem interop. It works well.
However, for some reason, if I build the M1/ARM64 version (or a Universal build) on GitHub actions, I get a ‘damaged’ DMG file (for the ARM64 build) and an odd Javascript/Node error for the universal build:
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at makeCallback (fs.js:136:11)
at rmdir (fs.js:671:14)
at Promise (internal/util.js:274:30)
at new Promise (<anonymous>)
at rmdir (internal/util.js:273:12)
at MacPackager.doPack (/Users/runner/work/Damselfly/Damselfly/Damselfly.Desktop/node_modules/app-builder-lib/src/macPackager.ts:123:15)
You can see the build failure for the Universal version here. The ARM64 build completes, but the resulting App fails to start, with MacOS saying it’s ‘damaged’.
Building locally on my M1 MacBook pro works fine. My hunch is that the GitHub Actions runners aren’t MacOS ARM64 hardware, so can’t build the M1 versions. But that’s weird, because my understanding is that electron-builder should be able to build ARM64/Universal targets on an Intel Mac (as per this issue. I’m sure it used to work about 3-4 weeks ago, and I haven’t seen any references to Electron build needing to run on M1 hardware to build M1 targets.
I’m using Electron 11.0.0, electron-builder 22.10.4, node 10.24.1. The OS that I’m running this on is 11.4 beta, on an M1 Macbook pro.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:41 (5 by maintainers)
Top GitHub Comments
Still an issue
Hello, I am experiencing this issue on an M1 Pro MBP running macOS Monterey 12.0.1. All of the apps built for the
arm64
architecture are reported as “damaged” when I download from github, but they open when built locally.Running
sudo xattr -r -d com.apple.quarantine "/Applications/myapp.app"
resolves the issue, but it’s not user-friendly. I hope that this will get fixed soon, I’ll unfortunately have to stick to building only forx64
architecture.