Skip to content

maker-dmg fails when run in parallel #3517

Closed

Description

@macdja38

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.3.0

Electron version

N/A

Operating system

macOS 14.3

Last known working Electron Forge version

It broke in 7.0.0

Expected behavior

Expect electron-forge make -- --arch=x64,arm64 to build both x64 and arm64 versions of the app.

Actual behavior

Both x64 and arm64 make steps fail.
with the error Target already exists
node_modules/appdmg/lib/appdmg.js:81:53

Steps to reproduce

electron-forge make -- --arch=x64,arm64

{
	name: "@electron-forge/maker-dmg",
	config: {
		debug: true,
		overwrite: true,
	},
	platforms: ["darwin"],
}

Additional information

For context it'll be helpful to read through this PR that changed how makers are run. #3363

I dug into this a bit.
the specific target error comes from appdmg.js:81:53

On a run through with just one target that succeeded:

console.log("Target step started", global.target);
at the start of that shows

[REDACTED]/desktop/out/make/OurAppName.dmg for both of the builds that are happening simultaneously

I took a look at the electron code that calls into that @electron-forge/maker-dmg/src/MakerDMG.ts
output on line 21 is the one used as the target.
forgeDefaultOutPath is fine though. For example:
[REDACTED]/desktop/out/make/OurAppName-1.2.3-arm64.dmg

dmgConfig is

overwrite = true
name = "OurAppName"
debug = true
icon = "assets/resources/icon.icns"
background = "assets/resources/installBackground.png"
appPath = "[REDACTED]/desktop/out/OurAppName-darwin-arm64/OurAppName.app"
out = "[REDACTED]/desktop/out/make"

Execution goes into the conditional (if !this.config.name)

I think this could probably be fixed by adding the targetArch to the outPath.

I plan on submitting a PR to fix this soon.

Activity

  1. kevincerro commented on Feb 29, 2024

    @kevincerro

    I have the same issue when building to arm and x64 using electron-forge make --arch=x64,arm64

  2. changed the title [-]maker-dmg fails [/-] [+]maker-dmg fails when run in parallel[/+] on Feb 29, 2024
  3. Innei commented on Aug 13, 2024

    @Innei

    Also in MakerSquirrel MakerAppImage

    with

       new MakerSquirrel((arch) => ({
          name: `Follow-${arch}`,
          setupIcon: "resources/icon.ico",
        })),
        new MakerAppImage((arch) => ({
          options: {
            name: `Follow-${arch}`,
            icon: "resources/icon.png",
            mimeType: ["x-scheme-handler/follow"],
          },
        })),
    
  4. didix16 commented on Sep 6, 2024

    @didix16

    I have the same issue when building to arm and x64 using electron-forge make --arch=x64,arm64

    Yeah me too. Is there any solution about that?

  5. lockiechen commented on Oct 21, 2024

    @lockiechen

    same here, any suggestion?

  6. macdja38 commented on Oct 22, 2024

    @macdja38
    ContributorAuthor

    I use the code in this PR via this npm package:

    "devDependencies": {
        "@electron-forge/maker-dmg": "https://registry.npmjs.org/@fellow/maker-dmg/-/maker-dmg-7.4.0.tgz",
    }
    
  7. tanishqkancharla commented on Nov 17, 2024

    @tanishqkancharla
    Contributor

    This is my workaround: I just use a different name for the dmg maker on different archs:

    new MakerDMG((arch) => ({
      name: `<app_name> Installer (${arch})`,
    })),
  8. added
    make
    on Jan 31, 2025
  9. added a commit that references this issue on Nov 17, 2025
  10. added
    maybe-fixed-in-next
    on Jul 1, 2026
  11. MarshallOfSound commented on Jul 1, 2026

    @MarshallOfSound
    Member

    This will be fixed in Electron Forge 8.

    There are currently alpha releases available on npm for you to try that are pretty stable. We should release 8.0.0 soon.

    For now merging this into #4082 to track the GA release of Forge 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmakemaker/dmgmaybe-fixed-in-nextplatform/macOS

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions