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

[Bug]: x86 electron cannot be installed on an M1 Mac #32119

Closed
3 tasks done
theicfire opened this issue Dec 6, 2021 · 1 comment
Closed
3 tasks done

[Bug]: x86 electron cannot be installed on an M1 Mac #32119

theicfire opened this issue Dec 6, 2021 · 1 comment
Labels

Comments

@theicfire
Copy link

theicfire commented Dec 6, 2021

Preflight Checklist

Electron Version

15.3.3

What operating system are you using?

macOS

Operating System Version

12.0.1

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

14.2.2

Expected Behavior

  • Run arch -x86_64 /bin/bash
  • Run npm install --arch=x64 electron@15.3
  • Run file node_modules/electron/dist/Electron.app/Contents/MacOS/Electron

You'll notice the arm64 version was installed, but I expected the x86 version to be installed.

Actual Behavior

The arm64 version was installed.

Testcase Gist URL

No response

Additional Information

This worked fine in 14.2.2:

  • Run npm install --arch=x64 electron@14.2.2
  • Run file node_modules/electron/dist/Electron.app/Contents/MacOS/Electron

A workaround that helped me:

rm -rf /tmp/fake_sysctl
mkdir /tmp/fake_sysctl
echo "echo 0" >> /tmp/fake_sysctl/sysctl_always_x86
ln -s /tmp/fake_sysctl/sysctl_always_x86 /tmp/fake_sysctl/sysctl
chmod a+x /tmp/fake_sysctl/sysctl
PATH=/tmp/fake_sysctl/:$PATH

This was inspired by noticing this PR: #29953

I believe that it is that PR that caused the regression. I'm trying to get this script to output "0" and it doesn't seem to matter if I'm running in rosetta mode or not:

// Try running with arch -x86_64 node test.js, and you'll still see "1" on the output
const childProcess = require('child_process');
const output = childProcess.execSync('sysctl -in sysctl.proc_translated');
console.log(output.toString());
@poiru
Copy link
Contributor

poiru commented Jan 7, 2022

This was just fixed by #32266.

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

3 participants