#have 'x86_64', need 'arm64'

3 messages · Page 1 of 1 (latest)

compact perch
#

He there everyone ~!

I'm working on app that's targeted to have a universal release, we recently incorporated a utilityProcess fork which is in charge of handling certain data pattern, for it we included certain native dependencies. The problem is that even when specifying the target as universal, the app packages both the x64 and arm64 apps, but only includes the native dependencies based on the host system architecture, so I've I build on my Intel Based system, it works perfectly fine, but arm64 users will get have 'x86_64', need 'arm64' and viceversa, if one of my teamates build on arm64 I get have 'arm64', need 'x86_64'

...
npmRebuild: true,
mac: {
  ...
  target: [
    {
      target: 'dmg',
      arch: 'universal',
    },
    {
      target: 'zip',
      arch: 'universal',
    },
  ],
  ...
},
...

The build is run the following way.

ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --mac --universal --publish never --config electron-builder.config.js

Here's the important version numbers

"electron": "^29.1.3",
"electron-builder": "^24.13.3",
"electron-store": "^8.1.0",
"electron-updater": "^5.3.0",
#

The app itself is based on electron react boilerplate (https://github.com/electron-react-boilerplate/electron-react-boilerplate)
So our native dependencies are listed on the release/app/package.json

Here's a regular build console output

  • electron-builder  version=24.13.3 os=22.6.0
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=release/build/builder-effective-config.yaml
  • rebuilding native dependencies  [email protected], [email protected] platform=darwin arch=x64
  • packaging       platform=darwin arch=x64 electron=29.1.3 appOutDir=release/build/mac-universal-x64-temp
  • rebuilding native dependencies  [email protected], [email protected] platform=darwin arch=arm64
  • packaging       platform=darwin arch=arm64 electron=29.1.3 appOutDir=release/build/mac-universal-arm64-temp
  • packaging       platform=darwin arch=universal electron=29.1.3 appOutDir=release/build/mac-universal
  • skipped macOS application code signing
  • building        target=DMG arch=universal file=release/build/app-mac-1.0.11(0).dmg
  • building        target=macOS zip arch=universal file=release/build/app-mac-1.0.11(0).zip
hdiutil: WARNING: udifrez is deprecated
  • building block map  blockMapFile=release/build/app-mac-1.0.11(0).dmg.blockmap

Additionally I've attempted to switch to the js type of config in order to use beforeBuild, but it didn't work

  beforeBuild: async context => {
    const { appDir, electronVersion, platform, arch } = context

    await rebuild({
      buildPath: appDir,
      electronVersion,
      platform: platform.nodeName,
      arch,
    })

    return false
  },

In fact it started having issues like the following,

Can't reconcile two non-macho files node_modules/bufferutil/build/Makefile

or

/node_modules/bufferutil/bin/darwin-arm64-121/bufferutil.node have the same architectures (arm64) and can't be in the same fat output file
stoic jewel
#

is there any update here?