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

Error: Detected file "Contents/Resources/app-server/Crypto/Cipher/_ARC4.abi3.so" that's the same in both x64 and arm64 builds and not covered by the x64ArchFiles rule: "undefined" #3125

Closed
3 tasks done
navdeepm20 opened this issue Dec 29, 2022 · 4 comments

Comments

@navdeepm20
Copy link

navdeepm20 commented Dec 29, 2022

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

6.0.4

Electron version

v21.2.3

Operating system

Windows 11 - version 10.0.22621 Build 22621

Last known working Electron Forge version

No response

Expected behavior

I am creating a universal build for max os. I have a fast API server running with electron and copying it into the resources directory by adding configs in pakagerConfig in forge.config.js.
Building individually for the x64 and arm64 works fine but when I pack it for universal using the command.

electron-forge package --arch universal

It should create the universal build for osx.

Actual behavior

I am creating a universal build for max os. I have a fast API server running with electron and copying it into the resources directory by adding configs in pakagerConfig in forge.config.js.
Building individually for the x64 and arm64 works fine but when I pack it for universal using the command.

electron-forge package --arch universal

It throws this error -

Error: Detected file "Contents/Resources/app-server/Crypto/Cipher/_ARC4.abi3.so" that's the same in both x64 and arm64 builds and not covered by the x64ArchFiles rule: "undefined"

Steps to reproduce

Command for packaging universal -

electron-forge package --arch universal

forge.config.js

 packagerConfig: {
    icon: process.platform==='darwin' ? path.resolve(__dirname, "AppIconMac.icns") : path.resolve(__dirname, "AppIcon.ico"),
    extraResource: path.resolve(__dirname, "./src/app-server"),
  },

Additional information

No response

@erickzhao
Copy link
Member

This error happens when the same x64 binaries are present in both the x64 and arm64 versions of your app.

I think you would need to set up the x64ArchFiles configuration option for @electron/universal like this:

// forge.config.js
{
  packagerConfig: {
    osxUniversal: { // config options for `@electron/universal`
      x64ArchFiles: '**/_ARC4.abi3.so' // replace with any relevant glob pattern
    }
  }
}

Ref electron/universal#47

@MarshallOfSound
Copy link
Member

Specifically you probably want these to be different between your builds. You could Allowlist it but your arm64 build should probably have an arm64 version of this file. Otherwise it may not run correctly on M1 hardware

@navdeepm20
Copy link
Author

Thanks for your response. Fixed this using

 x64ArchFiles: "*",

@erickzhao
Copy link
Member

You would be running a lot of files under x64 emulation with that particular configuration. I would recommend a more fine-grained approach.

In any case, I'll close this issue out since it can be solved with configuration.

@erickzhao erickzhao closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2023
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

3 participants