electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.59k stars 1.73k forks source link

Arch not being passed correctly, prebuild doing arm64 instead of x64 (Mac) #6340

Closed DanielMcAssey closed 2 years ago

DanielMcAssey commented 2 years ago

Getting the following, packaging line says x64 arch, but then the build native dependency step uses arm64? I tseems like the arch is not getting passed correctly

• packaging platform=darwin arch=x64 electron=10.4.7 appOutDir=release/mac-universal--x64 • install prebuilt binary name=robotjs version=0.6.0 platform=darwin arch=arm64 napi= • execute command command=/usr/local/Cellar/node/16.11.1/bin/node /Users/danielmcassey/Repositories/woodthorpe-it/train-app/node_modules/prebuild-install/bin.js --platform=darwin --arch=arm64 --target=10.4.7 --runtime=electron --verbose --force workingDirectory=/Users/danielmcassey/Repositories/woodthorpe-it/train-app/node_modules/robotjs • build native dependency from sources name=robotjs version=0.6.0 platform=darwin arch=arm64 napi= reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information) error=prebuild-install info begin Prebuild-install version 5.3.6 prebuild-install WARN install prebuilt binaries enforced with --force! prebuild-install WARN install prebuilt binaries may be out of date! prebuild-install info looking for cached prebuild @ /Users/danielmcassey/.npm/_prebuilds/2e8f26-robotjs-v0.6.0-electron-v82-darwin-arm64.tar.gz prebuild-install http request GET https://github.com/octalmage/robotjs/releases/download/v0.6.0/robotjs-v0.6.0-electron-v82-darwin-arm64.tar.gz prebuild-install http 404 https://github.com/octalmage/robotjs/releases/download/v0.6.0/robotjs-v0.6.0-electron-v82-darwin-arm64.tar.gz prebuild-install WARN install No prebuilt binaries found (target=10.4.7 runtime=electron arch=arm64 libc= platform=darwin)

Zmaon commented 2 years ago

I have the same issue. I'm trying to build for x64 on a Mac m1, it succeeds but the executable it outputs is always for arm64.

Zmaon commented 2 years ago

@DanielMcAssey Did you find a way around this? For now I have to use a x64 Mac to build.

DanielMcAssey commented 2 years ago

Unfortunately not yet, I am doing the same, using an x64 Mac to build. Makes our CI pipeline difficult

mmaietta commented 2 years ago

I think I recall this being an issue with app-builder-bin as I had this issue as well. My way of resolving it was ironically utilizing electron-rebuild instead. This is from my electron-builder.js

  // force arch build if using electron-rebuild
  beforeBuild: async (context) => {
    const { appDir, electronVersion, arch } = context
    await electronRebuild.rebuild({ buildPath: appDir, electronVersion, arch })
    return false
  },
  nodeGypRebuild: false,
  buildDependenciesFromSource: false,
stale[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

bbb169 commented 7 months ago

build native dependency from sources name=robotjs version=0.6.0 platform=darwin arch=x64 napi= reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information) error=prebuild-install info begin Prebuild-install version 5.3.6

I got the same issue, is there any way to solve this ?

mmaietta commented 7 months ago

@bbb169 try this approach? https://github.com/electron-userland/electron-builder/issues/6340#issuecomment-1027503443