Electron-builder: Plans to Support Apple Silicon builds?

Created on 3 Nov 2020  ·  87Comments  ·  Source: electron-userland/electron-builder

Are there current plans to support Apple Silicon builds with electron-builder? We're currently in the process of making sure our electron app is ready for ARM support, so I wanted to make sure that we'd be able to build to those targets using electron-builder.

If so, what does the release timeline look like for that?

Since https://github.com/electron-userland/electron-builder/issues/5095 was closed with no resolution, I figured it best to open a new issue.

Most helpful comment

FWIW, I was able to build an arm64 electron example app with the help of patch-package on two files. Perhaps this will help/unblock people investigating further 🙂

I was able to package via both yarn electron-builder to use package.json and cli yarn electron-builder --dir --arm64

Unfortunately, I'm actually unable to test the app though as I don't have a compatible MacOS version installed right now. Just to be verbose, here's the error alert

You can’t use this version of the application “MyApp.app” with this version of macOS.
You have macOS 10.15.7. The application requires macOS 11.0 or later.

Maybe someone would be willing to test this? 😉


Here are the changes I made:

package.json excerpt:

"build": {
    "appId": "test",
    "mac": {
      "target" : { "target": "dir", "arch": "arm64" }
    }
  },
  "devDependencies": {
    "electron": "11.0.0-beta.20",
    "electron-builder": "^22.9.1"
  },

Patch 1:
app-builder-lib+22.9.1.patch

diff --git a/node_modules/app-builder-lib/out/macPackager.js b/node_modules/app-builder-lib/out/macPackager.js
index 4825f78..2aa682b 100644
--- a/node_modules/app-builder-lib/out/macPackager.js
+++ b/node_modules/app-builder-lib/out/macPackager.js
@@ -258,7 +258,7 @@ class MacPackager extends _platformPackager().PlatformPackager {

     if (!hasMas || targets.length > 1) {
       const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${this.appInfo.productFilename}.app`) : prepackaged;
-      nonMasPromise = (prepackaged ? Promise.resolve() : this.doPack(outDir, path.dirname(appPath), this.platform.nodeName, arch, this.platformSpecificBuildOptions, targets)).then(() => this.packageInDistributableFormat(appPath, _builderUtil().Arch.x64, targets, taskManager));
+      nonMasPromise = (prepackaged ? Promise.resolve() : this.doPack(outDir, path.dirname(appPath), this.platform.nodeName, arch, this.platformSpecificBuildOptions, targets)).then(() => this.packageInDistributableFormat(appPath, arch, targets, taskManager));
     }

     for (const target of targets) {

Patch 2:
electron-builder+22.9.1.patch

diff --git a/node_modules/electron-builder/out/builder.js b/node_modules/electron-builder/out/builder.js
index 59383a1..8b9aef7 100644
--- a/node_modules/electron-builder/out/builder.js
+++ b/node_modules/electron-builder/out/builder.js
@@ -69,10 +69,6 @@ function normalizeOptions(args) {

   function processTargets(platform, types) {
     function commonArch(currentIfNotSpecified) {
-      if (platform === _appBuilderLib().Platform.MAC) {
-        return args.x64 || currentIfNotSpecified ? [_builderUtil().Arch.x64] : [];
-      }
-
       const result = Array();

       if (args.x64) {
@@ -242,7 +238,7 @@ function createTargets(platforms, type, arch) {
   const targets = new Map();

   for (const platform of platforms) {
-    const archs = platform === _appBuilderLib().Platform.MAC ? [_builderUtil().Arch.x64] : arch === "all" ? [_builderUtil().Arch.x64, _builderUtil().Arch.ia32] : [(0, _builderUtil().archFromString)(arch == null ? process.arch : arch)];
+    const archs = arch === "all" && platform !== _appBuilderLib().Platform.MAC ? [_builderUtil().Arch.x64, _builderUtil().Arch.ia32] : [(0, _builderUtil().archFromString)(arch == null ? process.arch : arch)];
     const archToType = new Map();
     targets.set(platform, archToType);


All 87 comments

any update on this?

Are there current plans to support Apple Silicon builds with electron-builder? We're currently in the process of making sure our electron app is ready for ARM support, so I wanted to make sure that we'd be able to build to those targets using electron-builder.

If so, what does the release timeline look like for that?

Since #5095 was closed with no resolution, I figured it best to open a new issue.

@eengoron see here they have put this ticket in backlog and marked closed even still electron-builder is not supporting ARM64 build. #5095

@ahmadwaliesipick -- I mentioned that ticket in my original message. That ticket was closed without resolution, so I opened a new one.

cc @develar

@ahmadwaliesipick -- I mentioned that ticket in my original message. That ticket was closed without resolution, so I opened a new one.

cc @develar

Yes @eengoron . Do you have any information are they working on ARM64 build?

Unfortunately, it looks like it's time to consider migrating to electron-packager for this issue :(

Anyone is willing to open a pull request? Fix should be easy, as far I see.

Can we get this issued pinned, saves all the duplicate issues being made and easier to focus for people helping out with pull requests and debugging. Either this one or any of the others

5095

FWIW, I was able to build an arm64 electron example app with the help of patch-package on two files. Perhaps this will help/unblock people investigating further 🙂

I was able to package via both yarn electron-builder to use package.json and cli yarn electron-builder --dir --arm64

Unfortunately, I'm actually unable to test the app though as I don't have a compatible MacOS version installed right now. Just to be verbose, here's the error alert

You can’t use this version of the application “MyApp.app” with this version of macOS.
You have macOS 10.15.7. The application requires macOS 11.0 or later.

Maybe someone would be willing to test this? 😉


Here are the changes I made:

package.json excerpt:

"build": {
    "appId": "test",
    "mac": {
      "target" : { "target": "dir", "arch": "arm64" }
    }
  },
  "devDependencies": {
    "electron": "11.0.0-beta.20",
    "electron-builder": "^22.9.1"
  },

Patch 1:
app-builder-lib+22.9.1.patch

diff --git a/node_modules/app-builder-lib/out/macPackager.js b/node_modules/app-builder-lib/out/macPackager.js
index 4825f78..2aa682b 100644
--- a/node_modules/app-builder-lib/out/macPackager.js
+++ b/node_modules/app-builder-lib/out/macPackager.js
@@ -258,7 +258,7 @@ class MacPackager extends _platformPackager().PlatformPackager {

     if (!hasMas || targets.length > 1) {
       const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${this.appInfo.productFilename}.app`) : prepackaged;
-      nonMasPromise = (prepackaged ? Promise.resolve() : this.doPack(outDir, path.dirname(appPath), this.platform.nodeName, arch, this.platformSpecificBuildOptions, targets)).then(() => this.packageInDistributableFormat(appPath, _builderUtil().Arch.x64, targets, taskManager));
+      nonMasPromise = (prepackaged ? Promise.resolve() : this.doPack(outDir, path.dirname(appPath), this.platform.nodeName, arch, this.platformSpecificBuildOptions, targets)).then(() => this.packageInDistributableFormat(appPath, arch, targets, taskManager));
     }

     for (const target of targets) {

Patch 2:
electron-builder+22.9.1.patch

diff --git a/node_modules/electron-builder/out/builder.js b/node_modules/electron-builder/out/builder.js
index 59383a1..8b9aef7 100644
--- a/node_modules/electron-builder/out/builder.js
+++ b/node_modules/electron-builder/out/builder.js
@@ -69,10 +69,6 @@ function normalizeOptions(args) {

   function processTargets(platform, types) {
     function commonArch(currentIfNotSpecified) {
-      if (platform === _appBuilderLib().Platform.MAC) {
-        return args.x64 || currentIfNotSpecified ? [_builderUtil().Arch.x64] : [];
-      }
-
       const result = Array();

       if (args.x64) {
@@ -242,7 +238,7 @@ function createTargets(platforms, type, arch) {
   const targets = new Map();

   for (const platform of platforms) {
-    const archs = platform === _appBuilderLib().Platform.MAC ? [_builderUtil().Arch.x64] : arch === "all" ? [_builderUtil().Arch.x64, _builderUtil().Arch.ia32] : [(0, _builderUtil().archFromString)(arch == null ? process.arch : arch)];
+    const archs = arch === "all" && platform !== _appBuilderLib().Platform.MAC ? [_builderUtil().Arch.x64, _builderUtil().Arch.ia32] : [(0, _builderUtil().archFromString)(arch == null ? process.arch : arch)];
     const archToType = new Map();
     targets.set(platform, archToType);


FWIW, I was able to build an arm64 electron example app with the help of patch-package on two files. Perhaps this will help/unblock people investigating further 🙂

I was able to package via both yarn electron-builder to use package.json and cli yarn electron-builder --dir --arm64

Unfortunately, I'm actually unable to test the app though as I don't have a compatible MacOS version installed right now. Just to be verbose, here's the error alert

You can’t use this version of the application “MyApp.app” with this version of macOS.
You have macOS 10.15.7. The application requires macOS 11.0 or later.

Maybe someone would be willing to test this? 😉

Here are the changes I made:

package.json excerpt:

"build": {
    "appId": "test",
    "mac": {
      "target" : { "target": "dir", "arch": "arm64" }
    }
  },
  "devDependencies": {
    "electron": "11.0.0-beta.20",
    "electron-builder": "^22.9.1"
  },

Patch 1:
app-builder-lib+22.9.1.patch

diff --git a/node_modules/app-builder-lib/out/macPackager.js b/node_modules/app-builder-lib/out/macPackager.js
index 4825f78..2aa682b 100644
--- a/node_modules/app-builder-lib/out/macPackager.js
+++ b/node_modules/app-builder-lib/out/macPackager.js
@@ -258,7 +258,7 @@ class MacPackager extends _platformPackager().PlatformPackager {

     if (!hasMas || targets.length > 1) {
       const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${this.appInfo.productFilename}.app`) : prepackaged;
-      nonMasPromise = (prepackaged ? Promise.resolve() : this.doPack(outDir, path.dirname(appPath), this.platform.nodeName, arch, this.platformSpecificBuildOptions, targets)).then(() => this.packageInDistributableFormat(appPath, _builderUtil().Arch.x64, targets, taskManager));
+      nonMasPromise = (prepackaged ? Promise.resolve() : this.doPack(outDir, path.dirname(appPath), this.platform.nodeName, arch, this.platformSpecificBuildOptions, targets)).then(() => this.packageInDistributableFormat(appPath, arch, targets, taskManager));
     }

     for (const target of targets) {

Patch 2:
electron-builder+22.9.1.patch

diff --git a/node_modules/electron-builder/out/builder.js b/node_modules/electron-builder/out/builder.js
index 59383a1..8b9aef7 100644
--- a/node_modules/electron-builder/out/builder.js
+++ b/node_modules/electron-builder/out/builder.js
@@ -69,10 +69,6 @@ function normalizeOptions(args) {

   function processTargets(platform, types) {
     function commonArch(currentIfNotSpecified) {
-      if (platform === _appBuilderLib().Platform.MAC) {
-        return args.x64 || currentIfNotSpecified ? [_builderUtil().Arch.x64] : [];
-      }
-
       const result = Array();

       if (args.x64) {
@@ -242,7 +238,7 @@ function createTargets(platforms, type, arch) {
   const targets = new Map();

   for (const platform of platforms) {
-    const archs = platform === _appBuilderLib().Platform.MAC ? [_builderUtil().Arch.x64] : arch === "all" ? [_builderUtil().Arch.x64, _builderUtil().Arch.ia32] : [(0, _builderUtil().archFromString)(arch == null ? process.arch : arch)];
+    const archs = arch === "all" && platform !== _appBuilderLib().Platform.MAC ? [_builderUtil().Arch.x64, _builderUtil().Arch.ia32] : [(0, _builderUtil().archFromString)(arch == null ? process.arch : arch)];
     const archToType = new Map();
     targets.set(platform, archToType);

I have Apple Silicon Big Sur machine will check and back to you.

f (platform === _appBuilderLib().Platform.MAC) {

@mmaietta I have tested but build failed because some packages not found while rebuild
https://github.com/atom/node-keytar/releases/download/v7.0.0/keytar-v7.0.0-electron-v82-darwin-arm64.tar.gz

https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-darwin-x64.tar.gz

@mmaietta your patches are working I managed to build my app for arm. It can be opened on the Apple DTK but crashes shortly after related to something about a electron, I will investigate and see If I can find any fixes. If you need your app tested on a DTK I'm free to test it.

@abhishekmatcha I expect native node modules are going to cause some issues for arm64 builds (see blog)

@mmaietta I noticed another place where x64 is hardcoded but it's not included in your patch

await this.dispatchArtifactCreated(artifactPath, null, Arch.x64, this.computeSafeArtifactName(artifactName, "pkg"))

@deathlyrage can you please also test if you can sign/notarize your application well? And what about MAS builds?

@mmaietta I have tested but build failed because some packages not found while rebuild
https://github.com/atom/node-keytar/releases/download/v7.0.0/keytar-v7.0.0-electron-v82-darwin-arm64.tar.gz

You need at least node-gyp 7.1.2 to build native modules for Mac/ARM64

Attempting to use x64 and arm64 targets together result in them uploading under the same name in deployment.
Can be solved by adding "artifactName" : "${productName}-${arch}-${version}.${ext}", under the mac tag in package.json.

Edit: doesn't look like this works, might be hard coded somewhere.

@aabuhijleh signing and notarization is working. Haven't tested MAS as I'm not using it yet.

@mmaietta I have tested but build failed because some packages not found while rebuild
https://github.com/atom/node-keytar/releases/download/v7.0.0/keytar-v7.0.0-electron-v82-darwin-arm64.tar.gz

You need at least node-gyp 7.1.2 to build native modules for Mac/ARM64

I am able to create build and notarized. But i have sqlite3 error now.
Uncaught Exception: Error: dlopen(/Users/kalpit/Documents/project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar.unpacked/node_modules/todo-api/node_modules/sqlite3/lib/binding/electron-v11.0-darwin-arm64/node_sqlite3.node, 1): no suitable image found. Did find: /Users/kalpit/Documents/project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar.unpacked/node_modules/todo-api/node_modules/sqlite3/lib/binding/electron-v11.0-darwin-arm64/node_sqlite3.node: mach-o, but wrong architecture /Users/kalpit/Documents/project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar.unpacked/node_modules/todo-api/node_modules/sqlite3/lib/binding/electron-v11.0-darwin-arm64/node_sqlite3.node: mach-o, but wrong architecture at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1812) at Object.Module._extensions..node (internal/modules/cjs/loader.js:1203:18) at Object.func [as .node] (electron/js2c/asar_bundle.js:5:2039) at Module.load (internal/modules/cjs/loader.js:992:32) at Module._load (internal/modules/cjs/loader.js:885:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12694) at Module.require (internal/modules/cjs/loader.js:1032:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (/Users/kalpit/Documents/project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar/node_modules/todo-api/node_modules/sqlite3/lib/sqlite3-binding.js:4:15) at Module._compile (internal/modules/cjs/loader.js:1152:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10) at Module.load (internal/modules/cjs/loader.js:992:32) at Module._load (internal/modules/cjs/loader.js:885:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12694) at Module.require (internal/modules/cjs/loader.js:1032:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (/Users/kalpit/Documents/project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar/node_modules/todo-api/node_modules/sqlite3/lib/sqlite3.js:2:15) at Module._compile (internal/modules/cjs/loader.js:1152:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10) at Module.load (internal/modules/cjs/loader.js:992:32) at Module._load (internal/modules/cjs/loader.js:885:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12694) at Module.require (internal/modules/cjs/loader.js:1032:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (/Users/kalpit/Documents/project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar/node_modules/todo-api/node_modules/any-db-sqlite3/index.js:3:20) at Module._compile (internal/modules/cjs/loader.js:1152:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10) at Module.load (internal/modules/cjs/loader.js:992:32) at Module._load (internal/modules/cjs/loader.js:885:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12694) at Module.require (internal/modules/cjs/loader.js:1032:19) at require (internal/modules/cjs/helpers.js:72:18) at getAdapter (/Users/kalpit/Documents/project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar/node_modules/todo-api/node_modules/any-db/index.js:27

@aabuhijleh signing and notarization is working. Haven't tested MAS as I'm not using it yet.

can we create dmg for arm64?

I have installed latest sqlite3 but still facing same error
rror: dlopen(/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar.unpacked/node_modules/todo-api/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node, 1): no suitable image found

@aabuhijleh signing and notarization is working. Haven't tested MAS as I'm not using it yet.

can we create dmg for arm64?

You need to use a dmg or .zip when transfering your .app to your mac, as copying the folder can loose some attributes and macos big sur won't load images that it cant verify, I had this problem and changed the target to dmg and it worked.

I have installed latest sqlite3 but still facing same error
rror: dlopen(/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar.unpacked/node_modules/todo-api/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node, 1): no suitable image found

I 'm not good at english ~
try lipo -info "your node_sqlite3.node path" see which arch it is
sqlite3 is using node-pre-gyp to build addon , node-pre-gyp is not support apple silicon , when you set "--arch=arm64" as configuration it don't work
you can try electron-rebuild to rebuild your addon , then try electron-builder to build the dmg
i'm trying this, it seems work

Wow, I wasn't expecting such quick responses! 😁

@mmaietta I have tested but build failed because some packages not found while rebuild
https://github.com/atom/node-keytar/releases/download/v7.0.0/keytar-v7.0.0-electron-v82-darwin-arm64.tar.gz
https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-darwin-x64.tar.gz

@ahmadwaliesipick you'll need 11.0.0-beta.1 or higher, that's when arm64 dist started to be released for Electron. For any native modules, you'll likely need to recompile directly as @ljy-xian mentioned since it'll be highly unlikely any other packages have already been packaging/storing arm64 builds for mac yet. The sqlite error is due to the fact that your native addon is not available in arm64 - no suitable image found

From: https://www.electronjs.org/blog/apple-silicon#native-modules
You need the following dependencies + versions

  • Xcode >=12.0.0
  • node-gyp >=7.1.0
  • electron-rebuild >=1.12.0
  • electron-packager >=15.1.0

Can be solved by adding "artifactName" : "${productName}-${arch}-${version}.${ext}", under the mac tag in package.json.

I recall some additional code that was conditional for adding the arch in the name, but I'll need to look that back up. I previously had to write some scripting for doing the same artifactName arch-injection for compiling ia32 vs x64 Windows apps separately. Seems the patch files might need to get a bit longer, possibly better in a gist soon

Nice catch @aabuhijleh! I don't use mas and definitely overlooked that point.

I have installed latest sqlite3 but still facing same error
rror: dlopen(/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar.unpacked/node_modules/todo-api/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node, 1): no suitable image found

I 'm not good at english ~
try lipo -info "your node_sqlite3.node path" see which arch it is
sqlite3 is using node-pre-gyp to build addon , node-pre-gyp is not support apple silicon , when you set "--arch=arm64" as configuration it don't work
you can try electron-rebuild to rebuild your addon , then try electron-builder to build the dmg
i'm trying this, it seems work

@ljy-xian Thanks for reply.
i am already using electron-rebuild. But still facing error.
can you verify the command and target should be this?
electron-builder --arm64
"target" : ["dmg","pkg"],

Wow, I wasn't expecting such quick responses! 😁

@mmaietta I have tested but build failed because some packages not found while rebuild
https://github.com/atom/node-keytar/releases/download/v7.0.0/keytar-v7.0.0-electron-v82-darwin-arm64.tar.gz
https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-darwin-x64.tar.gz

@ahmadwaliesipick you'll need 11.0.0-beta.1 or higher, that's when arm64 dist started to be released for Electron. For any native modules, you'll likely need to recompile directly as @ljy-xian mentioned since it'll be highly unlikely any other packages have already been packaging/storing arm64 builds for mac yet. The sqlite error is due to the fact that your native addon is not available in arm64 - no suitable image found

From: https://www.electronjs.org/blog/apple-silicon#native-modules
You need the following dependencies + versions

  • Xcode >=12.0.0
  • node-gyp >=7.1.0
  • electron-rebuild >=1.12.0
  • electron-packager >=15.1.0

Can be solved by adding "artifactName" : "${productName}-${arch}-${version}.${ext}", under the mac tag in package.json.

I recall some additional code that was conditional for adding the arch in the name, but I'll need to look that back up. I previously had to write some scripting for doing the same artifactName arch-injection for compiling ia32 vs x64 Windows apps separately. Seems the patch files might need to get a bit longer, possibly better in a gist soon

Nice catch @aabuhijleh! I don't use mas and definitely overlooked that point.

@mmaietta i am using 11.0.0-beta.20

erify the command and target should be this?

i patch electron-builder directly as @mmaietta mentioned
then run electron-builder --arm64 it works
then run the dmg on silicon MacOS 11.0.1 beta , it works too

erify the command and target should be this?

i patch electron-builder directly as @mmaietta mentioned
then run electron-builder --arm64 it works
then run the dmg on silicon MacOS 11.0.1 beta , it works too

@ljy-xian what should be in target?
once i create build with this electron-builder --arm64 and set "target" : ["dmg","pkg"] it create mac build.
and once i run electron-builder --mac with target
"target": { "target": "dir", "arch": "arm64" },

then it create correct mac-arm-64 build but dmg not create.

Please anyone share the correct format of electron-builder params and target params to create arm64 dmg.

@abhishekmatcha
i use electron cli to build , however it's the same
i think electron-builder will build dmg as default
./.node/bin/node ./node_modules/electron-builder/out/cli/cli.js --arm64 --config.productName=微盘
it will build both mac and dmg

Please anyone share the correct format of electron-builder params and target params to create arm64 dmg.
i use electron cli to build , however it's the same
i think electron-builder will build dmg as default
./.node/bin/node ./node_modules/electron-builder/out/cli/cli.js --arm64 --config.productName=微盘
it will build both mac and dmg

trying again i have missed patch :-D

@abhishekmatcha
i use electron cli to build , however it's the same
i think electron-builder will build dmg as default
./.node/bin/node ./node_modules/electron-builder/out/cli/cli.js --arm64 --config.productName=微盘
it will build both mac and dmg

@ljy-xian are you also using sqlite3? do you have issue with that?

Facing one more issue while creating dmg. I am testing on Apple Silicon Big Sur machine.

command=/Users/kalpit/Documents/project/todo-xplat/node_modules/app-builder-bin/mac/app-builder blockmap --input /Users/kalpit/Documents/project/todo-xplat/dist-app/Todo Cloud-TEST-10.5.11-mac.dmg --output /Users/kalpit/Documents/project/todo-xplat/dist-app/Todo Cloud-TEST-10.5.11-mac.dmg.blockmap assertion failed [abi_info.kind == AbiKind::TranslatedCode]: emulated forward to an arm pc that isn't in translated code. arm_pc=0x10242d4e8 abi_kind=6 emulation_interval=[0x102613234,0x10261324c) instruction_interval=[0x102613230, 0x10261324c) x86_rip=0x1436ff9 (ThreadContextRegisterState.cpp:677 move_to_instruction_boundary)

@ahmadwaliesipick
@ljy-xian are you also using sqlite3? do you have issue with that?
yes , but it seem works well
by the way , can you please delete my product's snapshots in your replies :-D

@ahmadwaliesipick
@ljy-xian are you also using sqlite3? do you have issue with that?
yes , but it seem works well
by the way , can you please delete my product's snapshots in your replies :-D

@ljy-xian I have removed snapshots

Which sqlite3 version you are using?

I have added sqlite3 error at github issues: https://github.com/mapbox/node-sqlite3/issues/1396

@ahmadwaliesipick
@ljy-xian are you also using sqlite3? do you have issue with that?
yes , but it seem works well
by the way , can you please delete my product's snapshots in your replies :-D

@ljy-xian I have removed snapshots

Which sqlite3 version you are using?

3.31.1
did you use lipo -info command to test your addon in node-sqlite3 ?

did you use lipo -info command to test your addon in node-sqlite3 ?

I have no idea about this lipo command. can you please send me correct example?
once i runlipo -info
result
lipo -info error: /Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: no input files specified usage: lipo <input_file> <command> [<options> ...] command is one of: -archs -create -detailed_info -extract <arch_type> [-extract <arch_type> ...] -extract_family <arch_type> [-extract_family <arch_type> ...] -info -remove <arch_type> [-remove <arch_type> ...] -replace <arch_type> <file_name> [-replace <arch_type> <file_name> ...] -thin <arch_type> -verify_arch <arch_type> ... options are one or more of: -arch <arch_type> <input_file> -hideARM64 -output <output_file> -segalign <arch_type> <alignment>

@mmaietta's patches work perfectly - except for native deps. I've set "npmRebuild": false, in package.json and used electron-rebuild with --arch arm64 to pre-build them

@mmaietta how about making a PR with these changes?

Guys i am stuck with sqlite3 rebuild issue. The requested sqlite3 prebuild is not exist.
node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/electron-v11.0-darwin-arm64.tar.gz node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/electron-v11.0-darwin-arm64.tar.gz node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/electron-v11.0-darwin-arm64.tar.gz node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (electron-v11.0 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/electron-v11.0-darwin-arm64.tar.gz node-pre-gyp verb command build [ 'rebuild' ]
I am using these versions
"electron": "^11.0.0-beta.23", "electron-rebuild": "^2.0.0",

anyone please help.

@ahmadwaliesipick
@ljy-xian are you also using sqlite3? do you have issue with that?
yes , but it seem works well
by the way , can you please delete my product's snapshots in your replies :-D

@ljy-xian I have removed snapshots
Which sqlite3 version you are using?

3.31.1
did you use lipo -info command to test your addon in node-sqlite3 ?

@ljy-xian its showing x86_64 :-(

 lipo -archs  dist-app/mac-arm64/Todo\ Cloud.app/Contents/Resources/app.asar.unpacked/node_modules/todo-api/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node 

x86_64

3.31.1

@ljy-xian sqlite3 version 3.31.1 not exists can you please confirm again?

@mmaietta how about making a PR with these changes?

@warpdesign, happy to attempt to. I'll need others to test it on their devices (DTK and/or BigSur) since I can't test locally on my company laptop. I finally was able to get tests on master branch to work locally for me today, so I'll aim to work on a PR this week.

@mmaietta I'm able to test for you if you want to message me with any details needed. Have both DTK and several silicon devices shipping in the first launch window. Both changes to electron builder or any apps you needed tested. Same for anyone else in this thread.

@mmaietta I can do some testing as well if needed (BigSur, x64).

Opened Draft PR https://github.com/electron-userland/electron-builder/pull/5426
Added instructions on how to set up a local dev environment from scratch with my feature branch and the electron-quick-start repo. You should also be able to apply the same instructions (yalc link <all the electron-builder packages>) for testing this with your own project as well.

As it turns out, my PR also enables you to use install-app-deps and buildDependenciesFromSource successfully for multiple archs. I added sqlite3 to the package.json and node-gyp builds with the correct architecture.

Example output:

$ electron-builder
  • electron-builder  version=22.8.1 os=19.6.0
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  • rebuilding native dependencies  [email protected] platform=darwin arch=arm64
  • rebuilding native dependency  name=sqlite3 version=5.0.0
  • packaging       platform=darwin arch=arm64 electron=11.0.0 appOutDir=dist/mac-arm64
  • default Electron icon is used  reason=application icon is not set
  • skipped macOS code signing  reason=identity explicitly is set to null
  • building        target=DMG arch=arm64 file=dist/electron-quick-start-1.0.0-arm64.dmg
  • rebuilding native dependencies  [email protected] platform=darwin arch=x64
  • rebuilding native dependency  name=sqlite3 version=5.0.0
  • building block map  blockMapFile=dist/electron-quick-start-1.0.0-arm64.dmg.blockmap
  • packaging       platform=darwin arch=x64 electron=11.0.0 appOutDir=dist/mac
  • skipped macOS code signing  reason=identity explicitly is set to null
  • building        target=DMG arch=x64 file=dist/electron-quick-start-1.0.0.dmg
  • building block map  blockMapFile=dist/electron-quick-start-1.0.0.dmg.blockmap
✨  Done in 157.86s.

Could anyone please test running these two builds for me on Big Sur (both x64 and DTK)?
electron-quick-start-1.0.0-arm64.dmg
electron-quick-start-1.0.0.dmg
Notes: It'll be a blank screen, it's just electron's example app. I presume x64 app would work with Rosetta 2, but IIRC that's not available to test on DTKs.

I added sqlite3 to the package.json and node-gyp builds with the correct architecture.

@mmaietta can you please share package.json file?

@mmaietta can you please share package.json file?

{
  "name": "electron-quick-start",
  "version": "1.0.0",
  "description": "A minimal Electron application",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "build": "electron-builder"
  },
  "repository": "https://github.com/electron/electron-quick-start",
  "keywords": [
    "Electron",
    "quick",
    "start",
    "tutorial",
    "demo"
  ],
  "author": "GitHub",
  "license": "CC0-1.0",
  "dependencies": {
    "sqlite3": "^5.0.0"
  },
  "devDependencies": {
    "electron": "^11.0.0",
    "electron-builder": "^22.9.1"
  },
  "build": {
    "buildDependenciesFromSource": true,
    "mac": {
      "identity": null,
      "target": {
        "target": "dmg",
        "arch": [
          "arm64",
          "x64"
        ]
      }
    }
  }
}

You can also just open the .app and unpack the asar directly to see what's within

@mmaietta can you please share which node and node-gyp version you are using?

@mmaietta can you please share which node and node-gyp version you are using?

$ node -v
v12.16.1
$ npm -version
6.13.4

Excerpt from package-lock.json

"node-gyp": {
      "version": "3.8.0",
      "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz",

@mmaietta can you please share which node and node-gyp version you are using?

$ node -v
v12.16.1
$ npm -version
6.13.4

Excerpt from package-lock.json

"node-gyp": {
      "version": "3.8.0",
      "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz",

@mmaietta but as per https://www.electronjs.org/blog/apple-silicon node-gyp must be>=7.1.0

¯\_(ツ)_/¯

You're correct, I don't know how it compiled then

If you're willing to set up your local env to test out the feature branch (instructions in the PR), that'd help immensely with debugging this.

¯_(ツ)_/¯

You're correct, I don't know how it compiled then

If you're willing to set up your local env to test out the feature branch (instructions in the PR), that'd help immensely with debugging this.

if i used node-gyp >=7.1.0 then the build showing error. can you please share feature branch name?

PR should have all the info you need... https://github.com/electron-userland/electron-builder/pull/5426
Fork -> mmaietta:Feature/AppleSiliconARM64

@mmaietta i have used above fork and after dmg create and open app i am still facing sqlite error :-(
Uncaught Exception: Error: dlopen(project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar.unpacked/node_modules/todo-api/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node, 1): no suitable image found. Did find: /project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar.unpacked/node_modules/todo-api/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node: mach-o, but wrong architecture /project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar.unpacked/node_modules/todo-api/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node: mach-o, but wrong architecture at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1812) at Object.Module._extensions..node (internal/modules/cjs/loader.js:1203:18) at Object.func [as .node] (electron/js2c/asar_bundle.js:5:2039) at Module.load (internal/modules/cjs/loader.js:992:32) at Module._load (internal/modules/cjs/loader.js:885:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12694) at Module.require (internal/modules/cjs/loader.js:1032:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar/node_modules/todo-api/node_modules/sqlite3/lib/sqlite3-binding.js:4:15) at Module._compile (internal/modules/cjs/loader.js:1152:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10) at Module.load (internal/modules/cjs/loader.js:992:32) at Module._load (internal/modules/cjs/loader.js:885:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12694) at Module.require (internal/modules/cjs/loader.js:1032:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (/project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar/node_modules/todo-api/node_modules/sqlite3/lib/sqlite3.js:2:15) at Module._compile (internal/modules/cjs/loader.js:1152:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10) at Module.load (internal/modules/cjs/loader.js:992:32) at Module._load (internal/modules/cjs/loader.js:885:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12694) at Module.require (internal/modules/cjs/loader.js:1032:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (/project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar/node_modules/todo-api/node_modules/any-db-sqlite3/index.js:3:20) at Module._compile (internal/modules/cjs/loader.js:1152:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10) at Module.load (internal/modules/cjs/loader.js:992:32) at Module._load (internal/modules/cjs/loader.js:885:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12694) at Module.require (internal/modules/cjs/loader.js:1032:19) at require (internal/modules/cjs/helpers.js:72:18) at getAdapter (/project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar/node_modules/todo-api/node_modules/any-db/index.js:27:10) at Object.connect [as createConnection] (/project/todo-xplat/dist-app/mac-arm64/Todo Cloud.app/Contents/Resources/app.asar/node_modules/todo-api/node_modules/any-db/index.js:14:17)

@mmaietta i think i have figured out i have issue with stdversion https://github.com/electron/electron/issues/26364 https://github.com/electron-userland/electron-builder/issues/5402
can you please confirm what is gcc version that you are using? Also can you please share which Big Sur version you have installed?

Yes, my team was able to resolve our native addon compilation issue by changing our cflags from -std=c++11 to c++14

As mentioned previously, I am not able to have Big Sur installed (at this time). I'll try and set up a different partition this weekend to test further

I can confirm that x64 dmg + app launches on Big Sur.
Can anyone please test this arm64 build on a DTK?
electron-quick-start-1.0.0-arm64.dmg

'electron-quick-start.app' is damaged and can't be opened. You should move it to the bin. (ON DTK)
Even after disabling and allowing apps from anywhere. Is it possible to get this as signed under a Developer ID cert so I don't have to resign it and possibly ruin the test results ^

Keep in mind big sur requires all apps to be signed now.

@develar @warpdesign It seems that master branch is broken for both builds and tests:
https://app.circleci.com/pipelines/github/electron-userland/electron-builder/172/workflows/8e811c33-4c20-41ff-affc-d4a6a7c3d71a/jobs/3169
This PR resolves that compilation issue and updates a few snapshots https://github.com/electron-userland/electron-builder/pull/5434. Please review when you have a chance

@deathlyrage my apologies, I overlooked that tid bit. I've reuploaded Dev-signed artifacts, same google drive url. (identityName=Apple Development: <email> (24KMVXPDMX))

electron-quick-start-1.0.0-arm64.dmg
@mmaietta I have installed and run app at Apple Silicon BigSur machine. here is screenshot
https://share.getcloudapp.com/RBu96Zvb

For anyone running into this issue with building arm64 native addons with node-gyp 7.1.0, you're likely receiving "Unsupported architecture" errors akin to this below (Note: MacOSX10.15.sdk)

    In file included from Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c:14012:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:68:
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
    #error Unsupported architecture
     ^

The solution is to get the MacOSX 11.1 SDK, which contains the necessary files for compiling for both arm64 and x64, which isn't available in Xcode 12.2. Steps below:

  1. Install Xcode Command Line Tools 12.3 Beta
  2. export SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk"
  3. yarn electron-builder install-app-deps --arch arm64

If still having trouble, try switching to python 3.8, and you can force it via export NODE_GYP_FORCE_PYTHON=<path>

Still working on resolving the remaining PR unit tests.

Side note:
For anyone that finds the node-gyp output via electron-builder logs obnoxious, here's a patch that cleans up the command wrapper. Basically, error.stack is error.message but with way too many CRLF, so the logging gets duplicated. This significantly helped me debugging the logs.
electron-builder+22.9.1.patch

diff --git a/node_modules/electron-builder/out/cli/cli.js b/node_modules/electron-builder/out/cli/cli.js
index e69d729..bab7423 100755
--- a/node_modules/electron-builder/out/cli/cli.js
+++ b/node_modules/electron-builder/out/cli/cli.js
@@ -160,9 +160,7 @@ function wrap(task) {
       if (error instanceof _builderUtil().InvalidConfigurationError) {
         _builderUtil().log.error(null, error.message);
       } else if (!(error instanceof _util().ExecError) || !error.alreadyLogged) {
-        _builderUtil().log.error({
-          stackTrace: error.stack
-        }, error.message);
+        _builderUtil().log.error(null, error.message);
       }
     });
   };

For anyone running into this issue with building arm64 native addons with node-gyp 7.1.0, you're likely receiving "Unsupported architecture" errors akin to this below (Note: MacOSX10.15.sdk)

    In file included from Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c:14012:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:68:
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
    #error Unsupported architecture
     ^

The solution is to get the MacOSX 11.1 SDK, which contains the necessary files for compiling for both arm64 and x64, which isn't available in Xcode 12.2. Steps below:

  1. Install Xcode Command Line Tools 12.3 Beta
  2. export SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk"
  3. yarn electron-builder install-app-deps --arch arm64

If still having trouble, try switching to python 3.8, and you can force it via export NODE_GYP_FORCE_PYTHON=<path>

Still working on resolving the remaining PR unit tests.

Side note:
For anyone that finds the node-gyp output via electron-builder logs obnoxious, here's a patch that cleans up the command wrapper. Basically, error.stack is error.message but with way too many CRLF, so the logging gets duplicated. This significantly helped me debugging the logs.
electron-builder+22.9.1.patch

diff --git a/node_modules/electron-builder/out/cli/cli.js b/node_modules/electron-builder/out/cli/cli.js
index e69d729..bab7423 100755
--- a/node_modules/electron-builder/out/cli/cli.js
+++ b/node_modules/electron-builder/out/cli/cli.js
@@ -160,9 +160,7 @@ function wrap(task) {
       if (error instanceof _builderUtil().InvalidConfigurationError) {
         _builderUtil().log.error(null, error.message);
       } else if (!(error instanceof _util().ExecError) || !error.alreadyLogged) {
-        _builderUtil().log.error({
-          stackTrace: error.stack
-        }, error.message);
+        _builderUtil().log.error(null, error.message);
       }
     });
   };

@mmaietta this also works for node-sqlite3 https://github.com/mapbox/node-sqlite3 ?

The solution is to get the MacOSX 11.1 SDK, which contains the necessary files for compiling for both arm64 and x64, which isn't available in Xcode 12.2. Steps below:

The full install of Xcode 12.2 includes the MacOSX 11 SDK, the problem is that the command line tools do not.

I suggest not to mix commandlinetools and xcode full installs since this usually causes a lot of problems.

Thanks for your work @mmaietta !

Now that electron 11 is out of the beta stage electron-builder is the last piece of the puzzle to be able to ship in a "clean" way our electron app also for M1 users!

@mmaietta I was able to build both x64 & ARM64 .dmg of React-Explorer using your fork/branch.

Nice job!

I could only test the x64 version though. Could anyone confirm the ARM64 version is working?

I could only test the x64 version though. Could anyone confirm the ARM64 version is working?

I get this when I try to run it
image

I don't think it likes the ad-hoc codesigning.

codesign -d -vvv /Applications/React-Explorer.app 
Executable=/Applications/React-Explorer.app/Contents/MacOS/React-Explorer
Identifier=Electron
Format=app bundle with Mach-O thin (arm64)
CodeDirectory v=20400 size=1697 flags=0x20002(adhoc,linker-signed) hashes=50+0 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha256=858e4121eff9d952e86c09d894c1bb2b9fb50b46
CandidateCDHashFull sha256=858e4121eff9d952e86c09d894c1bb2b9fb50b46fdacf8821e0d6fecadeb40b4
Hash choices=sha256
CMSDigest=858e4121eff9d952e86c09d894c1bb2b9fb50b46fdacf8821e0d6fecadeb40b4
CMSDigestType=2
CDHash=858e4121eff9d952e86c09d894c1bb2b9fb50b46
Signature=adhoc
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
Internal requirements=none

Working on fixing unit tests as the tests needed to upgrade to use electron 11, need to set up a windows VM to fix the remaining tests and test on another mac as my company laptop basically quarantines any dmg hdiutil creates 😅

Also worth noting, it seems that Big Sur removes hdiutil's flatten/unflatten, so that will need to be updated at some point, but I'd consider it outside the scope of this PR though since this builds correctly on Catalina.
For Big Sur we may need to investigate migrating to hdiutil's:

udifrez [options] image
                embed resources (e.g. a software license agreement) in a disk image.
udifderez [options] image
                extract resources from image.

@warpdesign I don't see node-gyp in the package-lock.json, I'm not sure what it was using to compile your native addon.
I cloned your repo, installed node-gyp, added arm64 and buildDependenciesFromSource to package.json mac target, forced MacOSX 11.1 sdk, and then recompiled + dev signed it. These are the builds if someone can test launching it on a DTK
React-Explorer-2.3.1-arm64.dmg
React-Explorer-2.3.1.dmg

Thanks for your work on this @mmaietta! I'm working on an electron-builder app and I have an M1 MacBook Pro running Big Sur, so I'm happy to help out.

I tried both of those DMGs, and they had the same behavior for me:

  • I got a security warning on launch, but opened the app via the Security & Privacy panel.
  • The app just shows this—not sure what the intended behavior is, though.

Screen Shot 2020-11-24 at 7 10 03 PM

  • I'm unable to quit the app. None of the close window button, ⌘-W, ⌘-Q, or menu bar options work. I had to force quit the app. Not sure if that's due to react-explorer or electron-builder.

More than happy to test more if it'd be helpful!

@tmacwill thanks for the tests!

Could you choose "Toggle Developer Tools" from the Window menu, click on "console", and copy/paste what is displayed here please?

I have created an issue here: https://github.com/warpdesign/react-explorer/issues/197

@mmaietta no idea why node-gyp isn't there. Native dependencies are supposed to be handled by electron-rebuild which is installed/used by electron-builder. As far as I know, I'm not supposed to include it myself in my project.

The builds you made don't seem to have the native dependency in the asar archive (drivelist.node): this explains why it's stuck on the loading screen. That's weird.

Sure, screenshot below. If this is specific to react-explorer, the issue you created is a better place to discuss, but if this is relevant to electron-builder itself, we can keep going here.

Screen Shot 2020-11-25 at 12 20 53 AM

@warpdesign I don't see node-gyp in the package-lock.json, I'm not sure what it was using to compile your native addon.
I cloned your repo, installed node-gyp, added arm64 and buildDependenciesFromSource to package.json mac target, forced MacOSX 11.1 sdk, and then recompiled + dev signed it. These are the builds if someone can test launching it on a DTK
React-Explorer-2.3.1-arm64.dmg
React-Explorer-2.3.1.dmg

I downloaded and extracted the DMG of the ARM64 version and the drivelist.node file in Contents/ressource/app.asar/node_modules/drivelist/build/Release/drivelist.node is an x64 binary.

It seems native dependencies are built for the host architecture, and not the specified --arch.

./node_modules/.bin/electron-builder install-app-deps --arch arm64
  • electron-builder  version=22.9.1
  • loaded configuration  file=package.json ("build" field)
  • rebuilding native dependencies  [email protected] platform=darwin arch=arm64

file node_modules/drivelist/build/Release/drivelist.node 
node_modules/drivelist/build/Release/drivelist.node: Mach-O 64-bit bundle x86_64

About the workflow in electron-builder and native modules.

I use a module that is prebuilt for the different architectures, at the moment in the "build" settings in package.json I have this:

   "mac": {
      "category": "public.app-category.sports",
      "extraResources": [
        {
          "from": "node_modules/@wyscout/hudl-graphx-core/prebuilds/darwin-x64",
          "to": "app/node_modules/@wyscout/hudl-graphx-core/prebuilds/darwin-x64",
          "filter": [ "**/*"  ]
        }
      ]
    },
    "win": {
      "extraResources": [
        {
          "from": "node_modules/@wyscout/hudl-graphx-core/prebuilds/win32-x64",
          "to": "app/node_modules/@wyscout/hudl-graphx-core/prebuilds/win32-x64",
          "filter": [ "**/*" ]
        }
      ]
    }

The arch switch you added in the "mac" section should allow me to write also:

 "from": "node_modules/@wyscout/hudl-graphx-core/prebuilds/darwin-${arch}"
 "to": "app/node_modules/@wyscout/hudl-graphx-core/prebuilds/darwin-${arch}"

... correct?

@tmacwill could you try downloading both arm64 & x64 builds again?

getting the same security error, but otherwise the app looks like it works now (and also quits correctly).

getting the same security error, but otherwise the app looks like it works now (and also quits correctly).

Good news! Which version (arm, x64) did you try?

Both, same behavior.

Great!

Could you show me the about window of both versions please?

Le mer. 25 nov. 2020 à 19:11, Tommy MacWilliam notifications@github.com a
écrit :

Both, same behavior.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/electron-userland/electron-builder/issues/5392#issuecomment-733869048,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AABQXYAOCE2LILW4FBXBBA3SRVCGDANCNFSM4TJBHO2A
.

@warpdesign I noticed that for your node module, driver, it only compiles an x64 even when node-gyp is executed with arm64. Oddly, sqlite3 generates both archs and I'm not sure why there's differing behavior here:

./node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node
./node_modules/sqlite3/lib/binding/napi-v3-darwin-x64/node_sqlite3.node

./node_modules/drivelist/build/Release/drivelist.node

Not sure what happens but I successfully built an arm64 binary using
electron-rebuild --arch arm64.

Le mer. 25 nov. 2020 à 19:41, Mike Maietta notifications@github.com a
écrit :

@warpdesign https://github.com/warpdesign I noticed that for your node
module, driver, it only compiles an x64 even when node-gyp is executed
with arm64. Oddly, sqlite3 generates both archs and I'm not sure why
there's differing behavior here:

./node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node
./node_modules/sqlite3/lib/binding/napi-v3-darwin-x64/node_sqlite3.node

./node_modules/drivelist/build/Release/drivelist.node


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/electron-userland/electron-builder/issues/5392#issuecomment-733885339,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AABQXYERFO35MI2IOQZBEJTSRVFUTANCNFSM4TJBHO2A
.

Screen Shot 2020-11-25 at 11 44 54 AM

Screen Shot 2020-11-25 at 11 45 40 AM

@warpdesign what happens when you attempt to build a native addon for x64 and arm64 in the same pipeline?
AFAICT, node-gyp doesn't have an output path configuration so only one artifact appears at /build/Release, right?

I've updated my arm64-support PR but the CI can't give its stamp of approval because master branch is already broken. The PRs being merged aren't showing build/tests passing, and master branch naturally doesn't either. The build can't complete and the yarn.lock wasn't updated properly to include the new npm dependency it added.

@develar I've started another PR. It currently fixes the compiler issues, but it seems more tests are still broken. I'm investigating further. https://github.com/electron-userland/electron-builder/pull/5449

Quick updates:

Compiler PR https://github.com/electron-userland/electron-builder/pull/5449 fixing master branch is approved and ready for merge.

Apple Silicon PR https://github.com/electron-userland/electron-builder/pull/5426 is approved with PR tests passing (CI post-merge test is failing and fixed in Compiler PR linked above). Once the compiler PR is merged, I would advocate for rerunning the CI builds for the Apple Silicon PR for proper validation against master branch and just as a merge strategy, in general. We should then be ready for a pre-release cut for broader testing.
Note: Universal x64+arm64 Electron builds were not available at the time and has not been tested yet.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thomasnordquist picture thomasnordquist  ·  95Comments

romangetman picture romangetman  ·  43Comments

lingxf2002 picture lingxf2002  ·  48Comments

consense picture consense  ·  48Comments

ghost picture ghost  ·  51Comments