electron-builder: Operation not permitted during dmg building on macOS 11 Big Sur

  • Version: electron-builder@22.9.1
  • Electron Version:electron@11.0.4
  • Electron Type (current, beta, nightly):current
  • Electron updater: electron-updater@4.3.1
  • Target: dmg for macOS

After setting DEBUG=electron-builder DEBUG_DMG=true, the console logs error during copy:

2020-12-10 11:45:43.585 copy-helper[54295:350710] About to copy "/path/app.app".
2020-12-10 11:45:44.255 copy-helper[54295:350710] copy error (canceling): /Volumes/img/app.app/Contents/Resources/app.asar.unpacked/node_modules/npm/node_modules/libnpmorg/.BC.T_K9LSTf: Operation not permitted
2020-12-10 11:45:44.255 copy-helper[54295:350710] Copy finished with error 1 (Operation not permitted).
................................Error 1 (Operation not permitted).
could not access /Volumes/img/app.app/Contents/Resources/app.asar.unpacked/node_modules/npm/node_modules/libnpmorg/.BC.T_K9LSTf - Operation not permitted

Then building ultimately failed with:

2020-12-10 11:45:45.386 diskimages-helper[54280:350655] *useEffectiveIDs**** euid/egid changed to 501,20 (uid/gid is 501,20)
DIHLDiskImageCreate() returned 1
hdiutil: create: returning 1
hdiutil: create failed - Operation not permitted

...

 ⨯ hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE  stackTrace=
                                                                    Error: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
                                                                        at ChildProcess.<anonymous> (/Users/gnattu/src/poi/node_modules/builder-util/src/util.ts:243:14)
                                                                        at Object.onceWrapper (node:events:483:26)
                                                                        at ChildProcess.emit (node:events:376:20)
                                                                        at maybeClose (node:internal/child_process:1063:16)
                                                                        at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)

I can create an image with appdmg for the same app.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (2 by maintainers)

Commits related to this issue

Most upvoted comments

By removing “-fs”, “HFS+”, “-fsargs”, “-c c=64,a=16,e=16”, dmg creation does work on Big Sur. Looks like HFS+ image creation is broken.

@lutzroeder Yes, I can confirm that some files are incorrectly signed:

xattr PULL_REQUEST_TEMPLATE 
com.apple.cs.CodeDirectory
com.apple.cs.CodeEntitlements
com.apple.cs.CodeRequirements
com.apple.cs.CodeRequirements-1
com.apple.cs.CodeSignature

The file is just a text file indicating a PR template, but it is detected as a binary and got signed.