Skip to content

hdiutil unmount issue blocks dmg creation for MacOS builds #4606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ashleysimpson opened this issue Jan 21, 2020 · 52 comments · Fixed by #5724
Closed

hdiutil unmount issue blocks dmg creation for MacOS builds #4606

ashleysimpson opened this issue Jan 21, 2020 · 52 comments · Fixed by #5724

Comments

@ashleysimpson
Copy link

Versions in use:

  • electron-builder: 21.2.0
  • electron: 5.0.2
  • node: 12.0.0

Building for MacOS

Issue:

We recently upgraded our technical stack to allow for the notarization of our app. We are using electron-notarize and for the most part, everything works as expected. Unfortunately, when building our application for distribution we are running into a problem with MacOS where the dmg creation fails about 90% of the time (you can check the supplied logs in the issue for more information). We thought that the problem might be something with our setup and we spent a significant amount of time digging into that but to no avail.

After checking things over we decided to look into electron-builder and after setting the debug flags DEBUG=electron-builder DEBUG_DMG=true we see that there is a problem when running the hdiutil command in electron-builder. I did some research and the only references to this error are back from 2016 here: #854. Unfortunately, we have no antivirus running and none of the comments in that thread have helped.

The problem we are facing really slows us down and we often have to build 10 or more times before we get a successful build. Has anyone else faced this issue? Is there something silly I am overlooking? Any help would be really appreciated. If more logs are useful then please let me know and I can post a more detailed logging output. Thanks for the help in advance.

Relevant logs:

[20:05:03] 2020-01-21 20:04:58.562 diskimages-helper[94927:334169] *useEffectiveIDs**** euid/egid changed to 501,20 (uid/gid is 501,20)
[20:05:03] DIHLDiskImageCreate() returned 49168
[20:05:03] hdiutil: create: returning 49168
[20:05:03] hdiutil: create failed - Resource busy

[20:05:03] • exited command=hdiutil code=1 pid=94924
[20:05:03] • async task error error=hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
[20:05:26] • building embedded block map file=dist/App.zip
[20:05:26] • spawning command=/Users/builder/buildslave/app/build/node_modules/app-builder-bin/mac/app-builder blockmap --input /Users/builder/buildslave/app/build/dist/App.zip --compression deflate
[20:05:26] • exited command=app-builder code=0 pid=95022 out={"size":71064404,"sha512":"T9qUijiL5hlbvHQDF8dY8os8yKj/uTGeVmq060HtN+/MJy7ryuAxiOjq+aTXHb17h88vh7bl+yZ8LpQFFcyLDQ=="
@activenode
Copy link

I experienced the same thing but it appeared to happen on electron@7.1.10 with electron-builder@22.3.2 as well.

After having researched I found #2115 (comment) which then let me re-check the versions.

tl:dr:

  • I upgraded to the newest version (since before I had the same as you)
  • Most importantly: I deleted my global installations of electron and electron-builder. For whatever reason npx took the global ones instead of the local ones.

First make sure there is no global installation left by doing:

npm remove electron -g
npm remove electron-builder -g

After that check if there is still a global one as a leftover (like in my case that was the issue):

which electron
which electron-builder

After that and after upgrading the versions it should be alright.

@activenode
Copy link

Have to roll back here. It still happens from time to time.

@ashleysimpson
Copy link
Author

Ahh okay, it's too bad that updating the package didn't fix it but thanks for the reply.

@assanepenbase
Copy link

assanepenbase commented Feb 13, 2020

Hi,
I'm facing the same issue with a lower version of electron, electron-builder and node.
The version I use :

  • electron-builder: 20.44.4
  • electron : 3.1.11
  • node : 10.9.0
  • macOSX : 10.14.6 Mojave

My application used to build fine 3 months ago but since two weeks the dmg creation fails almost every time. I suspect an issue with my current macOSX version combined with my fusion hard drive but I have no more idea.
Have you found a solution ?
Any help would be really appreciated.

Thanks in advance.

@ashleysimpson
Copy link
Author

Unfortunately, we are still dealing with the same problem... If we find anything, I will update this issue.

@michaelrbock
Copy link

Same problem here. Versions:

  • "electron-builder": "^22.3.2"
  • "electron": "^7.1.2",
  • node: v12.8.1
  • macOSX: 10.15.3

@renaldasrep
Copy link

renaldasrep commented Mar 1, 2020

Has anyone solved this? Having the same issue here
Seems to be working fine on my machine but fails 95% of the time on CI

 Error: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
      at ChildProcess.<anonymous> (<PATH_TO_APP>/node_modules/builder-util/src/util.ts:239:14)
      at Object.onceWrapper (events.js:428:26)
      at ChildProcess.emit (events.js:321:20)
      at maybeClose (internal/child_process.js:1026:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

OR

 Error: Exit code: 16. Command failed: hdiutil detach -force /dev/disk2
      hdiutil: couldn't eject "disk2" - Resource busy
      hdiutil: couldn't eject "disk2" - Resource busy
      at <PATH_TO_APP>/node_modules/builder-util/src/util.ts:125:16
      at ChildProcess.exithandler (child_process.js:310:5)
      at ChildProcess.emit (events.js:321:20)
      at maybeClose (internal/child_process.js:1026:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

@renaldasrep
Copy link

Worked around by using macOS 10.13 for now

@sparky-raccoon
Copy link

Hi,
Facing the same issue with older versions of electron and electron-builder.

"electron-builder": "^21.0.2"
"electron": "^6.0.11",
node: v13.8.0
macOSX: 10.15.3

Not sure if it's related, but as I build .dmg quite regularly with electron-builder, I think the first time I had this issue was right after I started to use the iCloud storage .. 👽

@michaelkozakovsc
Copy link

Same issue here on OSX 10.15.3. This machine is running Sophos antivirus, which i have no way of disabling

@johanpoirier
Copy link

johanpoirier commented Apr 1, 2020

Hi,

I'm facing the same issue:

electron-builder: 21.2.0
electron: 5.0.13
node: 10.16.3
macOSX: 10.15.4

I have no AV active on the system. It stopped working the day I upgraded MacOS X to Catalina.

Any idea @develar ?

Thanks for your time.

@johanpoirier
Copy link

The logs:

spawning command=/Users/auser/workspace/dev/projects/aproject/node_modules/builder-util/node_modules/app-builder-bin/mac/app-builder blockmap --input /Users/auser/workspace/dev/projects/aproject/electron-builds/App-2.1.2-mac.zip --compression deflate
  • exited          command=hdiutil code=1 pid=59034
  • async task error  error=hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
  • exited          command=app-builder code=0 pid=59060 out={"size":429014698,"sha512":"WoZmDVcgfMPCs1q2UvV7Vy9t4TYu6ZoBE6ClrDoexH9OSa+0UqPzJVAzF+cjQWGK3bbmUnE0dxlEz/gsrsp04Q==","blockMapSize":411782}
  • getPublishConfigsForUpdateInfo: no publishConfigs, detect using repository info
  • calling getInfo  reason=owner or project is not specified explicitly provider=github owner=undefined project=undefined
  • executing       file=security args=delete-keychain /var/folders/gc/7vgy7x5970g1mm8jkv5v48zc0000gn/T/981e2e2758ea5bd31cb9672c97c157a6dd388ac7ae2f9737dd805e19cf091e7a.keychain
  • executed        file=security
  ⨯ hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE  stackTrace=
                                                                    Error: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
                                                                        at ChildProcess.childProcess.once.code (/Users/auser/workspace/dev/projects/aproject/node_modules/builder-util/src/util.ts:243:14)
                                                                        at Object.onceWrapper (events.js:286:20)
                                                                        at ChildProcess.emit (events.js:198:13)
                                                                        at maybeClose (internal/child_process.js:982:16)
                                                                        at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)

@sparky-raccoon
Copy link

sparky-raccoon commented Apr 8, 2020

It still happens a lot on my side, but from time to time it works again. I don't have any clue why. 😞
I have tried to update my package versions (they're not globally installed) but I didn't notice any changes. Also, I'm running with Sophos too, maybe that's a hint, referring @michaelkozakovsc comment.

@HyperSprite
Copy link

Same thing here. I've been seeing it randomly for the past month or two but usually waiting a little bit and trying again once or twice succeeds.
I've got a local Minio bucket as well as real S3 bucket and I've seen both error the same way, so it does not seem like a network timeout issue. Never had electron or electron-builder -g installed. Tried rm -rf node_modules && yarn. Today I've tried eight or nine times with no luck.

electron-builder: 22.4.1
electron: 7.1.12
node: 12.8.1
osx: 10.15.4 (also saw this on 10.15.3)
S3 bucket

When I got the error this time, I hit cmd-c to kill it and got some additional logging, not sure if it is helpful though.

• uploading       file=MyApp-1.12.11-alpha.2-mac.zip provider=S3
  ⨯ hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE  stackTrace=
                                                                    Error: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
                                                                        at ChildProcess.<anonymous> (/Users/usernamehere/Code/myapp/node_modules/builder-util/src/util.ts:239:14)
                                                                        at Object.onceWrapper (events.js:313:26)
                                                                        at ChildProcess.emit (events.js:223:5)
                                                                        at maybeClose (internal/child_process.js:1021:16)
                                                                        at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
^C  • canceling       signal=interrupt
  ⨯ MultipartUpload: upload multipart failed
	upload id: <somelongstring>
caused by: RequestCanceled: request context canceled
caused by: context canceled
github.com/develar/app-builder/pkg/publisher.upload
	/Volumes/data/Documents/app-builder/pkg/publisher/s3.go:169
github.com/develar/app-builder/pkg/publisher.ConfigurePublishToS3Command.func1
	/Volumes/data/Documents/app-builder/pkg/publisher/s3.go:57
github.com/alecthomas/kingpin.(*actionMixin).applyActions
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/actions.go:28
github.com/alecthomas/kingpin.(*Application).applyActions
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:557
github.com/alecthomas/kingpin.(*Application).execute
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:390
github.com/alecthomas/kingpin.(*Application).Parse
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:222
main.main
	/Volumes/data/Documents/app-builder/main.go:90
runtime.main
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:203
runtime.goexit
	/usr/local/Cellar/go/1.14/libexec/src/runtime/asm_amd64.s:1373

As I finished writing this my mac said there was an update. I installed that and rebooted (MacOs version did not change). Ran yarn release and it worked on the first try. Maybe I just needed to reboot, don't know.

@johanpoirier
Copy link

Also, I'm running with Sophos too, maybe that's a hint, referring @michaelkozakovsc comment.

I recently removed Sophos AV and it was working again perfectly. Sophos was not active but still installed on the system. So I think Sophos was the issue for me.

I fixed the problem by moving all the build to Azure Pipelines.

@sparky-raccoon
Copy link

I uninstalled Sophos today and it works again 🎉

@jlf123
Copy link

jlf123 commented May 14, 2020

+1 I'm also having this issue

ghost pushed a commit to rabix/composer that referenced this issue May 28, 2020
Update build.yml in an effort to capture DMG output
Local build fails due to Sophos anti-virus shenanigans
(electron-userland/electron-builder#4606)
@patrickhulce
Copy link

I'm having this issue intermittently on a factory reset Mojave 10.4.6 Mac Mini without any anti-virus installed. It's a build machine as clean as a whistle with no globals installed, no AV, not even an extra browser installed, nothing. If there's anything logging or environment wise I can provide to help fix this, I'd be happy to provide :)

@manderson-te
Copy link

manderson-te commented Aug 2, 2020

I wrestled with this exact issue for several hours tonight until I came across this post on superuser.com, which led me to try disabling Spotlight indexing: https://electrictoolbox.com/disable-spotlight-indexing-mac-osx/. After running sudo mdutil -a -i off the build started working immediately. If you're still struggling with this issue, then I'd try doing the same.

As for why Sophos could have been material to other folks' problems, I figure that's because Sophos must scan your disk in the same problematic way that Spotlight does. That's just speculation, though.

EDIT: changed the mdutil command to disable indexing to all stores on all volumes.

@DerekNMartin
Copy link

+1 also experiencing this issue - I do have Sophos, but unable to disable/uninstall it
electron-builder: 22.8.0
electron: 7.1.9

@Daanoz
Copy link

Daanoz commented Aug 21, 2020

Stopped working for me as well, and yes, also Sophos enforced on my machine...

  • electron: 8.2.5
  • electron-builder: 22.6.0

I guess it's impossible to get the Mac build working in a docker container?

@ashleysimpson
Copy link
Author

Hey @manderson-te!

We tried this solution but it didn't work for us, unfortunately. Thanks for the suggestion though.

@wardellbagby
Copy link
Contributor

I also see this, but only on GitHub Actions and never locally. Very intermittent; it fails about 40% of the time. Can give full logs if desired.

@alexpelan
Copy link

I believe the underlying issue here is fixed by this pull request: LinusU/node-appdmg#190

@sohelsd
Copy link

sohelsd commented Nov 21, 2020

I am seeing this issue consistently when I try to export a dmg. I do have Sophos and cannot be disabled unfortunately. Is there any other work around?

@cychainey
Copy link

I was having the same issue in a CI pipeline running with:

  • macOSX: 11.1
  • electron": 10.1.5
  • electron-builder: 22.9.1
  • node : 12.20.1

Changed node version to 14.3.0, and the builds have been working fine.
I don't have Sophos, so don't know whether that would still cause the error though.

@hijklmno
Copy link

Uninstalling Sophos and upgrading node from 12.18.3 to 14.15.4 did it for me, after updating to macOSX 11.1.

@stephenquan
Copy link

If you are running Sophos (or any other antivirus for that matter), try adding an exclusion for the temporary mount point of your DMG. i.e. add /Volumes/${VOLNAME} to the list of exclused directories to your antivirus, where you replace ${VOLNAME} with the actual name given to the hdiutil, i.e. hdiutil create ${OUTPUTDMG} -volname ${VOLNAME?} ...

@thomaschampagne
Copy link

Same issue for me:

  • macOS 11.2.2 Big Sur (Macbook Air M1)
  • electron: 12.0.0
  • electron-builder: 22.10.5
  • node: 15.10.0

If a run a single arch it works: electron-builder build --mac --arm64 --publish onTagOrDraft

However it fails when using 2 arch: electron-builder build --mac --x64 --arm64 --publish onTagOrDraft

Build at: 2021-03-04T01:23:43.863Z - Hash: ed2d739a6f07b4f883f0 - Time: 45909ms
  • electron-builder  version=22.10.5 os=20.3.0
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=package/builder-effective-config.yaml
  • packaging       platform=darwin arch=x64 electron=12.0.0 appOutDir=package/mac
  • Unpacking electron zip  zipPath=undefined
  • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, see https://electron.build/code-signing allIdentities=
                                                1) BF7784AF2A047808D55F02081F02D47922CC8219 "Thomas Champagne" (CSSMERR_TP_NOT_TRUSTED)
                                                   1 identities found
                                              
                                                Valid identities only
                                                   0 valid identities found
  • building        target=DMG arch=x64 file=package/elevate-installer.dmg
  • packaging       platform=darwin arch=arm64 electron=12.0.0 appOutDir=package/mac-arm64
  • Unpacking electron zip  zipPath=undefined
  • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, see https://electron.build/code-signing allIdentities=
                                                1) BF7784AF2A047808D55F02081F02D47922CC8219 "Thomas Champagne" (CSSMERR_TP_NOT_TRUSTED)
                                                   1 identities found
                                              
                                                Valid identities only
                                                   0 valid identities found
  • building        target=DMG arch=arm64 file=package/elevate-installer.dmg
  ⨯ Cannot cleanup: 

Error #1 --------------------------------------------------------------------------------
Error: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
    at ChildProcess.<anonymous> (/Users/thomas/Documents/Projects/elevate/desktop/node_modules/builder-util/src/util.ts:243:14)
    at Object.onceWrapper (node:events:485:26)
    at ChildProcess.emit (node:events:378:20)
    at maybeClose (node:internal/child_process:1067:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

Error #2 --------------------------------------------------------------------------------
Error: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
    at ChildProcess.<anonymous> (/Users/thomas/Documents/Projects/elevate/desktop/node_modules/builder-util/src/util.ts:243:14)
    at Object.onceWrapper (node:events:485:26)
    at ChildProcess.emit (node:events:378:20)
    at maybeClose (node:internal/child_process:1067:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)  stackTrace=

@thatsnoi
Copy link

I have the same issue with an M1 mac, works with GitHub actions though

@mmaietta
Copy link
Collaborator

@bjbk, does this issue occur on M1 for only universal builds or also if building explicitly just x64 or arm64?

Would you be willing to report back with using this for your mac config and the debug flag?

process.env.DEBUG='electron-*'

mac: {
  "artifactName": "${name}-${arch}.${ext}",
  "target": {
    "arch": [
      "x64"
    ],
    "target": "dmg"
  }
}

All in all, I have an optimistic ETA of 2 weeks for an M1.

@bjbk
Copy link

bjbk commented Mar 21, 2021

Just a quick response (wasn't able to get the debug logs yet)

arch: 'arm64' -> failed

building        target=DMG arch=arm64 file=dist/electron/Packaged/redacted-arm64.dmg
  • Above command failed, retrying 5 more times
  • Above command failed, retrying 4 more times
  • Above command failed, retrying 3 more times
  • Above command failed, retrying 2 more times
  • Above command failed, retrying 1 more times
  • Above command failed, retrying 0 more times

arch: 'x64' -> failed

  • building        target=DMG arch=x64 file=dist/electron/Packaged/redacted.dmg
  • Above command failed, retrying 5 more times
  • Above command failed, retrying 4 more times
  • Above command failed, retrying 3 more times
  • Above command failed, retrying 2 more times
  • Above command failed, retrying 1 more times
  • Above command failed, retrying 0 more times

same error:
Error: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE

Will work on getting debug logs.

@mmaietta
Copy link
Collaborator

mmaietta commented Mar 21, 2021

@bjbk shot in the dark here, can you try commenting out this line in your local package?

imageArgs.push("-fs", "HFS+", "-fsargs", "-c c=64,a=16,e=16")

In my local install, it's line 304 of ./node_modules/dmg-builder/out/dmg.js

Related note, adding the env DEBUG flag will also add -debug to the hdiutil operations, so that could be quite helpful output

@bjbk
Copy link

bjbk commented Mar 21, 2021

Not sure how much you need from the vast debug log, but this is just where it fails:

arch: arm64

DIHLDiskImageCreate() returned 1
hdiutil: create failed - Operation not permitted
  • exited          command=hdiutil code=1 pid=56234
  • Above command failed, retrying 0 more times
  • async task error  error=hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE

 App · ⚠️  [FAIL] electron-builder could not build

Will comment out the line indicated and try again.

@bjbk
Copy link

bjbk commented Mar 21, 2021

Commented out the line imageArgs.push("-fs", "HFS+", "-fsargs", "-c c=64,a=16,e=16") then changed my config back to universal.

Success!! No errors!

DIHLDiskImageCreate() returned 0
image-components:
        0: /private/var/folders/qq/ms4wb8nn5pl8yl68x3c8rn2c0000gn/T/t-eWp43l/0.dmg
created: /private/var/folders/qq/ms4wb8nn5pl8yl68x3c8rn2c0000gn/T/t-eWp43l/0.dmg
  • exited          command=hdiutil code=0 pid=57656
  • executing       file=hdiutil args=resize -size 727064651.5 /private/var/folders/qq/ms4wb8nn5pl8yl68x3c8rn2c0000gn/T/t-eWp43l/0.dmg
  • executed        file=hdiutil
  • executing       file=hdiutil args=attach -noverify -noautoopen -readwrite /private/var/folders/qq/ms4wb8nn5pl8yl68x3c8rn2c0000gn/T/t-eWp43l/0.dmg
  • executed        file=hdiutil stdout=
                      /dev/disk6                GUID_partition_scheme          
                      /dev/disk6s1              Apple_APFS                     
                      /dev/disk7                EF57347C-0000-11AA-AA11-0030654
                      /dev/disk7s1              41504653-0000-11AA-AA11-0030654 /Volumes/redacted-universal

@mmaietta
Copy link
Collaborator

mmaietta commented Mar 21, 2021

Alrighty, great progress!
If you're willing to be a guinea pig again, would you please try again with the line back but without the fsargs?

imageArgs.push("-fs", "HFS+")

I've been trying to get those fsargs removed for a hot minute but never had explicit proof it was impacting the build process.

@bjbk
Copy link

bjbk commented Mar 21, 2021

Nope, no dice. 😞

Build failed. This is very interesting, BTW! Thanks for letting me help! (I hope this is helping!) 😂

@mmaietta
Copy link
Collaborator

Oh dangit, well that's the smoking gun. My best guess is that M1's can't build a dmg with HFS+ filesystem or M1's simply don't support HFS+ at all. APFS has been out since 2017, so it's a reasonable surprise-Apple-roundhouse-kick for it to be enforced now 😅

@bjbk
Copy link

bjbk commented Mar 21, 2021

Oh dangit, well that's the smoking gun. My best guess is that M1's can't build a dmg with HFS+ filesystem or M1's simply don't support HFS+ at all. APFS has been out since 2017, so it's a reasonable surprise-Apple-roundhouse-kick for it to be enforced now 😅

That seems a reasonable conclusion. Price of 'progress' I suppose!

@mmaietta
Copy link
Collaborator

Can you try with this then? If this works, then you might have created the solution to this M1 issue 😉

imageArgs.push("-fs", "APFS")

Builds fine locally on my Intel-mac.

The problem now is how to handle backward compatibility...
APFS is supported by 10.12+
HFS+ is just OLD AF.

Building dmg's on M1 innately means that users will blindly be dropping support of pre-Sierra Macs, so there's not much electron-builder can do there. And if we don't fix this, then dmg-builder doesn't work for any new Mac machine.

The only route I see here is to conditionally select HFS+ on intel mac, and then for M1's, using APFS and adding a logger.warn('Assembling dmg on Apple Silicon, HFS+ is unavailable. Using APFS'). What are your thoughts?

@bjbk
Copy link

bjbk commented Mar 21, 2021

Build successful as anticipated.

App · [SUCCESS] electron-builder built the app

The logger warning sounds reasonable. I'm not really qualified (experienced enough) to elaborate further. Perhaps a note in the docs would be prudent as well.

The resulting DMG opened on my Intel Mac as expected too.

mmaietta pushed a commit to mmaietta/electron-builder that referenced this issue Mar 22, 2021
…s. Apple Silicon dropped support for creating dmgs with HFS+ (electron-userland#4606)
mmaietta pushed a commit to mmaietta/electron-builder that referenced this issue Mar 22, 2021
…s. Apple Silicon dropped support for creating dmgs with HFS+ (electron-userland#4606)
mmaietta added a commit that referenced this issue Mar 31, 2021
* fix: conditionally setting dmg filesystem to APFS for arm64 processors. Apple Silicon dropped support for creating dmgs with HFS+ (#4606)
smk762 added a commit to KomodoPlatform/komodo-wallet that referenced this issue Dec 7, 2021
@fpena06
Copy link

fpena06 commented Feb 9, 2022

I experienced the same thing but it appeared to happen on electron@7.1.10 with electron-builder@22.3.2 as well.

After having researched I found #2115 (comment) which then let me re-check the versions.

tl:dr:

  • I upgraded to the newest version (since before I had the same as you)
  • Most importantly: I deleted my global installations of electron and electron-builder. For whatever reason npx took the global ones instead of the local ones.

First make sure there is no global installation left by doing:

npm remove electron -g npm remove electron-builder -g

After that check if there is still a global one as a leftover (like in my case that was the issue):

which electron which electron-builder

After that and after upgrading the versions it should be alright.

I can confirm this worked for me.

@evil-shrike
Copy link

evil-shrike commented Oct 21, 2022

it's still happening for me on electron-builder@23.6.0 and electron@21.1.1, Mac OS 12.6 M1 on building for x64 arch with the following options:

  "mac": {
    "artifactName": "${productName}_${version}.${ext}",
    "category": "public.app-category.utilities",
    "target": [
      {
        "target": "dmg",
        "arch": [
          "x64",
          "arm64"
        ]
      }
    ]
  },

error:

  1) BC0B6CE886D5DA40684330C63E48549C10890A1B "Macops MDM"
     1 valid identities found
  • building        target=DMG arch=arm64 file=release/0.1.0/Workbench_0.1.0.dmg
  • Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+
  ⨯ Cannot cleanup:

Error #1 --------------------------------------------------------------------------------
Error: hdiutil process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
    at ChildProcess.<anonymous> (/Users/xxx/work/workbench/node_modules/builder-util/src/util.ts:250:14)
    at Object.onceWrapper (node:events:628:26)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)

@HyunhoCho
Copy link

I find solution.
I remove dmg title option, and it done!!!!

//dmg:{
//title: test
//}

and another solution is that i write another dmg-title name.... (ex) test1 or tes )
yes it is very strange issue.

@nswon
Copy link

nswon commented Oct 13, 2023

problem (it is warning, dmg build is not fail)

Above command failed, retrying 5 more times
Above command failed, retrying 4 more times

resolve

npm remove electron -g
npm remove electron-builder -g
npm i -D electron electron-builder

thankyou! @activenode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.