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

"bundled" version isn't compatible with Intel Macs (arm64 executable) #194

Open
DivadNojnarg opened this issue Jan 21, 2025 · 6 comments · May be fixed by #201
Open

"bundled" version isn't compatible with Intel Macs (arm64 executable) #194

DivadNojnarg opened this issue Jan 21, 2025 · 6 comments · May be fixed by #201

Comments

@DivadNojnarg
Copy link

I installed air on 2 different machines, a Mac M2 (a week ago) and an imac intel (today). For the latter, I had to do extra steps to make it start, described below.

The error message I had

air Language Server client: couldn't create connection to server.

Using bundled executable as requested by `air.executableLocation`: /Users/davidgranjon/.positron/extensions/posit.air-vscode-0.2.0-darwin-x64/bundled/bin/air
[Error - 21:43:41] Air Language Server client: couldn't create connection to server.
Error: spawn Unknown system error -86
	at ChildProcess.spawn (node:internal/child_process:421:11)
	at Object.spawn (node:child_process:777:9)
	at /Users/davidgranjon/.positron/extensions/posit.air-vscode-0.2.0-darwin-x64/dist/extension.js:1:350928
	at async S.createConnection (/Users/davidgranjon/.positron/extensions/posit.air-vscode-0.2.0-darwin-x64/dist/extension.js:1:183353)
	at async S.start (/Users/davidgranjon/.positron/extensions/posit.air-vscode-0.2.0-darwin-x64/dist/extension.js:1:173807)
	at async t.Lsp.startImpl (/Users/davidgranjon/.positron/extensions/posit.air-vscode-0.2.0-darwin-x64/dist/extension.js:1:93568)
	at async /Users/davidgranjon/.positron/extensions/posit.air-vscode-0.2.0-darwin-x64/dist/extension.js:1:92347
	at async /Users/davidgranjon/.positron/extensions/posit.air-vscode-0.2.0-darwin-x64/dist/extension.js:1:441412

For the Intel Mac this is what I have:

R version 4.2.2 Patched (2022-10-31 r83219)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.7.2

with Positron:

Positron Version: 2025.01.0 (Universal) build 152
Code - OSS Version: 1.95.0
Commit: 66aa3fb7f98eb8d19155cb7220856154f6ede8b3
Date: 2025-01-06T02:47:02.050Z
Electron: 32.2.1
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Darwin x64 22.6.0

I installed the cli 0.2.0 and downloaded the Air - R Language Support extension from the market place.

In my settings I need to do this to get it start:

"[r]": {
        "editor.formatOnSave": true
    },
    "air.executableLocation": "environment"

Specifically the "air.executableLocation": "environment" variable.

I also observed the same issue on a more recent Positron build (159).


Fun fact, I also updated the M2 installation with the new air cli and the market place extension released today. I can keep the executable location as bundled. I use the same build release for Positron: https://github.com/posit-dev/positron/releases/tag/2025.01.0-152

@DavisVaughan
Copy link
Collaborator

My first thought was that the Intel Mac release of air is busted, but the fact that you say it works if you use "environment" is interesting, as that means it isn't busted.

So that instead seems to imply that your "bundled" version isn't compatible with your Intel mac somehow, and our github actions workflows have gone awry, at least that's my next guess.

What does this return for you on your intel mac?

file /Users/davidgranjon/.positron/extensions/posit.air-vscode-0.2.0-darwin-x64/bundled/bin/air

PS thanks for the early testing!

@DivadNojnarg
Copy link
Author

DivadNojnarg commented Jan 21, 2025

When I install the CLI on Mac intel I get:

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/posit-dev/air/releases/download/0.2.0/air-installer.sh | sh

downloading air 0.2.0 x86_64-apple-darwin
installing to /Users/davidgranjon/.local/bin
  air
everything's installed!
$ file /Users/davidgranjon/.local/bin/air
/Users/davidgranjon/.local/bin/air: Mach-O 64-bit executable x86_64

Yes it seems that the bundled version is for arm64:

$file /Users/davidgranjon/.positron/extensions/posit.air-vscode-0.2.0-darwin-x64/bundled/bin/air
/Users/davidgranjon/.positron/extensions/posit.air-vscode-0.2.0-darwin-x64/bundled/bin/air: Mach-O 64-bit executable arm64

So the error makes sense.

@DavisVaughan
Copy link
Collaborator

Perfect that should give us enough to go off, thanks!

@DivadNojnarg DivadNojnarg changed the title air only starts if "air.executableLocation": "environment" is set in settings.json "bundled" version isn't compatible with Intel Macs (arm64 executable) Jan 21, 2025
@DavisVaughan
Copy link
Collaborator

Ah of course, we run both mac builds on macos-latest (so, with ARM support)

- os: macos-latest
target: x86_64-apple-darwin
code-target: darwin-x64
- os: macos-latest
target: aarch64-apple-darwin
code-target: darwin-arm64

So of course our installer is going to try and pull the ARM version even when we are attempting to bundle the x86 version

- run: curl -LsSf https://github.com/posit-dev/air/releases/latest/download/air-installer.sh | sh

@DavisVaughan
Copy link
Collaborator

See also axodotdev/cargo-dist#1720

@DavisVaughan
Copy link
Collaborator

DavisVaughan commented Jan 21, 2025

Looks like we could alternatively download and unpack https://github.com/posit-dev/air/releases/latest/download/air-x86_64-apple-darwin.tar.gz ourselves (and if we do it for one OS we may as well do it for all of them for consistency? and not use the installer script directly?)

@DavisVaughan DavisVaughan linked a pull request Jan 23, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants