electron-releases: Can't no longer create macOS universal binary with @castlabs/electron-releases

I received this error when building macOS universal binary with @castlabs/electron-releases v15.2.0

Error: Expected all non-binary files to have identical SHAs when creating a universal build but "Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/MainMenu.nib/keyedobjects-101300.nib" did not

I checked the path, Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/MainMenu.nib in the electron@15.2.0 and @castlabs/electron-releases@15.1.2 is a file but is a directory in @castlabs/electron-releases@15.2.0 with two files: keyedobjects.nib and keyedobjects-101300.nib.

Is there a way to fix this?

About this issue

Most upvoted comments

I can confirm this was resolved in electron-builder 23.0.4. All good now.

@sulf, check this comment out. In short, the .sig files are VMP signatures and they are safe to remove before creating your universal build (they would be invalidated anyway, and you would need to use EVS to re-sign).

Edit: Ideally some kind of mechanism for creating actions on a per file-type or path could be added to @electron/universal, which would allow easier handling of cases like this. I’ve been playing with some ideas around that but I’ve not had time to realize anything and submit a PR.

@khwaaj

a little tips for Electron Forge users who wants to have DRM and sign universal but make sure that their non universal build is not failing as well

do your macos normal arch x64 and arm64 inside the packageAfterExtract hook and do the fs.unlink here.

and the universal inside postPackage

do the

  1. Widevide sign
  2. osx-sign with the const { signAsync } = require('@electron/osx-sign');
  3. osx-notarize with const { notarize } = require('@electron/notarize');

Because of the strcuture of the universal inside the electron-packager that are being used inside the electron-forge

Yeah, our team is preparing a PR for it. I’m sure they just forgot about it.

No need to change dist-url. Instead all we needed was to add a simple addition to package.json:

"build": {
  "electronVersion": "xxx"
},

Looks like that’s picked up by electron-rebuild and works like a charm.

Not for this release, no, but I’ll see if we can figure something out for upcoming releases. I can’t say for sure exactly when it will happen though, so in the mean time you would need to use the workaround I suggested.

I’d actually argue that ibtool should be deterministic in this case, the same way it is for the bplist version of the nib, but waiting for Apple to get that fixed may not be an option so I’ll look into other alternatives too. I’ll post any further updates in this ticket.