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

Not recognizing arch values #3789

Open
3 tasks done
timeowilliams opened this issue Dec 18, 2024 · 2 comments
Open
3 tasks done

Not recognizing arch values #3789

timeowilliams opened this issue Dec 18, 2024 · 2 comments
Labels

Comments

@timeowilliams
Copy link

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

Electron version

33.0.2

Operating system

macOS M1 Pro - Sequioa 15.1.1

Last known working Electron Forge version

7.5.0

Expected behavior

Architecture Targeting Not Working as Expected

Description
When specifying multiple target architectures (x64 and arm64) in the packagerConfig, electron-forge only builds for arm64 and ignores the x64 architecture.

Configuration
I have specified both architectures in my forge config:

const config: ExtendedForgeConfig = {
  packagerConfig: {
    arch: ['x64', 'arm64'],
    // ... other config
  }
  // ... rest of config
}

Expected Behavior
The build process should create packages for both specified architectures (x64 and arm64).

Environment:

  • electron-forge/cli version: 7.5.0
  • Node.js version: v20.17.0
  • Operating System: macOS M1 Pro - Sequioa 15.1.1
  • Electron version: 33.0.2

Additional Notes:
The logs show that despite specifying both architectures in the config, the packager options only include arch: 'arm64'. This suggests the configuration might not be properly passed through to electron-packager.

Related Documentation:

Actual behavior

Current Behavior
Based on the logs, electron-forge is only targeting arm64:

Target Architectures: arm64

Steps to reproduce

Reproduction Steps:

  1. Set up a forge config with multiple architectures as shown above
  2. Run the packaging command
  3. Observe that only arm64 build is created

Additional information

No response

@timeowilliams
Copy link
Author

Currently, the ForgePackagerOptions type explicitly omits the arch option, making it difficult for users to properly configure multiple target architectures in their Electron Forge configuration.

Considering raising a PR to help users specify builds within forge itself. Features include:

  • Include arch in the ForgePackagerConfig interface
  • Add proper validation for arch values
  • Support both single arch and multiple arch configurations

@erickzhao
Copy link
Member

Hey @timeowilliams, thanks for the issue report.

The commands in the Forge CLI itself accept --arch as an option (e.g. electron-forge package --arch=x64). Does that suit your needs?

https://www.electronforge.io/cli#options-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants