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

On M1, charliermarsh.ruff-2023.54.0 is failing with OSError: [Errno 86] Bad CPU type in executable #364

Closed
cpbotha opened this issue Dec 14, 2023 · 3 comments

Comments

@cpbotha
Copy link

cpbotha commented Dec 14, 2023

It looks like the x86_64 build of ruff is accidentally bundled with the arm64 package.

The full error from the extension host log is:

2023-12-14 22:09:28.445 [error] [charliermarsh.ruff] provider FAILED
2023-12-14 22:09:28.445 [error] Error: OSError: [Errno 86] Bad CPU type in executable: '/Users/charlbotha/.vscode/extensions/charliermarsh.ruff-2023.54.0-darwin-arm64/bundled/libs/bin/ruff'
    at /Users/charlbotha/.vscode/extensions/charliermarsh.ruff-2023.54.0-darwin-arm64/dist/webpack:/ruff/node_modules/vscode-jsonrpc/lib/common/connection.js:567:57
    at message (/Users/charlbotha/.vscode/extensions/charliermarsh.ruff-2023.54.0-darwin-arm64/dist/webpack:/ruff/node_modules/vscode-jsonrpc/lib/common/connection.js:662:26)
    at isDisposed (/Users/charlbotha/.vscode/extensions/charliermarsh.ruff-2023.54.0-darwin-arm64/dist/webpack:/ruff/node_modules/vscode-jsonrpc/lib/common/connection.js:338:42)
    at Immediate.<anonymous> (/Users/charlbotha/.vscode/extensions/charliermarsh.ruff-2023.54.0-darwin-arm64/dist/webpack:/ruff/node_modules/vscode-jsonrpc/lib/common/connection.js:409:13)
    at processImmediate (node:internal/timers:476:21

Indeed, file confirms that the binary is x86_64 and not arm64:

$ file /Users/charlbotha/.vscode/extensions/charliermarsh.ruff-2023.54.0-darwin-arm64/bundled/libs/bin/ruff
/Users/charlbotha/.vscode/extensions/charliermarsh.ruff-2023.54.0-darwin-arm64/bundled/libs/bin/ruff: Mach-O 64-bit executable x86_64

This was also mentioned in a recent comment on another recent issue:
#362 (comment)

I was able to work around this by installing an arm64 build of ruff 0.1.8 using homebrew, and then pointing the vscode extension to it at /opt/homebrew/bin/ruff via the ruff.path user setting.

@charliermarsh
Copy link
Member

Huh, what, how on Earth...? We didn't change anything in the build pipeline. I'll look into it, thanks a ton for filing this.

@charliermarsh
Copy link
Member

Okay, something changed such that both the X86 and ARM Darwin builds went from using the Universal to the X86 wheel. Will fix this shortly... In the meantime, you can install Ruff with pip and the extension should defer to that version.

@charliermarsh
Copy link
Member

Should be fixed in the latest release (2023.56.0, publishing now).

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

2 participants