Skip to content
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

Electron forge fails to create x64 DMG on arm64 with error related to fs-xattr #3604

Open
3 tasks done
wojtekn opened this issue May 21, 2024 · 0 comments
Open
3 tasks done

Comments

@wojtekn
Copy link

wojtekn commented May 21, 2024

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.2.0

Electron version

29.1.0

Operating system

macOS 14.4.1

Last known working Electron Forge version

No response

Expected behavior

electron-forge make builds x64 DMG on arm64 Mac

Actual behavior

electron-forge make fails to build x64 DMG on arm64 Mac and throws the error.

Steps to reproduce

  1. Clone and install https://github.com/Automattic/studio
  2. Run command to build x64 DMG on arm64 Mac:
FILE_ARCHITECTURE=x64 node_modules/.bin/electron-forge make --arch=x64 --platform=darwin
  1. Notice the error:
An unhandled rejection has occurred inside Forge:
Error: dlopen(/Volumes/Sites/local-environment/node_modules/fs-xattr/build/Release/xattr.node, 0x0001): tried: '/Volumes/Sites/local-environment/node_modules/fs-xattr/build/Release/xattr.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Volumes/Sites/local-environment/node_modules/fs-xattr/build/Release/xattr.node' (no such file), '/Volumes/Sites/local-environment/node_modules/fs-xattr/build/Release/xattr.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1327:18)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Function.Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/Volumes/Sites/local-environment/node_modules/fs-xattr/index.js:3:15)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Object.require.extensions.<computed> [as .js] (/Volumes/Sites/local-environment/node_modules/ts-node/src/index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Function.Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/Volumes/Sites/local-environment/node_modules/appdmg/lib/util.js:6:15)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)

Additional information

I tried reproducing the issue using a clean Electron app but with no luck:

  1. Initialize the app
npm init electron-app@latest my-app
cd my-app
  1. Edit forge.config.js and add DMG maker:
    {
      name: '@electron-forge/maker-dmg',
      config: {
		  icon: 'assets/studio-app-icon.icns',
	  },
    }
  1. Run the build:
FILE_ARCHITECTURE=x64 node_modules/.bin/electron-forge make --arch=x64 --platform=darwin
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

No branches or pull requests

1 participant