Skip to content

Add native Apple Silicon (osx-arm64) language server - #690

Open
sergeyol wants to merge 1 commit into
anzwdev:masterfrom
sergeyol:osx-arm64-language-server
Open

sergeyol wants to merge 1 commit into
anzwdev:masterfrom
sergeyol:osx-arm64-language-server

Conversation

@sergeyol

@sergeyol sergeyol commented Sep 25, 2026 •

Copy link
Copy Markdown

Summary

On Apple Silicon Macs, AZALDevToolsServer.NetCore currently runs as an x86_64 process under Rosetta, because build.ps1 only publishes a self-contained osx-x64 build for macOS.

The same was true previously for Microsoft's AL binaries, but as of 18.x version of AL extension, they switched to automatic runtime acquiring and building "on-the-fly": microsoft/AL#8251.

It is important because Apple is starting to phase out Intel support via Rosetta 2: Mac OS v28 will not support it at all in a year; Mac OS v27 uninstalls Rosetta with an option to install it back.

This PR adds an osx-arm64 build and makes the extension pick it when VS Code runs natively on arm64.

Changes

  • build.ps1: additionally publish the server with -r osx-arm64 into bin/netcore/darwin-arm64 (and clear that folder together with the others).
  • toolsLangServerClient.ts: on darwin with os.arch() === "arm64", start bin/netcore/darwin-arm64/AZALDevToolsServer.NetCore; otherwise the path is unchanged. An x64 VS Code build (including one running under Rosetta) keeps using the existing darwin binaries.

No C# changes are needed: the server projects are plain net10.0 (AnyCPU), and the AL compiler assemblies loaded from the Microsoft AL extension (Microsoft.Dynamics.Nav.CodeAnalysis*.dll, …EditorServices.Protocol.dll) are IL-only.

Testing

On an Apple Silicon Mac (macOS 15, .NET SDK 10.0.401), built from master (18.81.0) against AL extension 18.0.2732683:

  • dotnet publish … -r osx-arm64 --self-contained builds with no new warnings; output has the same file set as the osx-x64 build, with arm64 Mach-O binaries.
  • Started the arm64 server and sent an al/documentsymbols request over stdio: correct symbol tree returned, vmmap reports Code Type: ARM64.
  • Replaced bin/netcore/darwin of the installed 18.81.0 extension with the arm64 build as a local test.
  • build.ps1 parses cleanly in PowerShell 7; npm run compile passes.

Rough indication only (single run, includes process start): first al/documentsymbols round-trip took 2.66 s with the x64 build under Rosetta vs 0.52 s with the arm64 build.

Notes

  • Package size: this adds a second self-contained macOS runtime, which is ~87 MB unpacked in the VSIX. If that's a concern, an alternative is publishing platform-specific VSIXs (vsce package --target darwin-arm64, etc.), but that changes the release process, so I kept this PR minimal.
  • I didn't touch CHANGELOG.md since versioned entries look maintainer-managed; happy to add one.
  • linux-arm64 could be added the same way if wanted.

🤖 Generated with Claude Code

On Apple Silicon Macs the language server currently runs as an x86_64
process under Rosetta, because only an osx-x64 self-contained build is
published for macOS.

- build.ps1: additionally publish the server for osx-arm64 into
  bin/netcore/darwin-arm64
- toolsLangServerClient.ts: start the darwin-arm64 binary when VS Code
  itself runs as an arm64 process; x64 VS Code (incl. under Rosetta)
  keeps using the existing darwin build

No C# changes are needed: the server projects are AnyCPU and the AL
compiler assemblies loaded from the Microsoft AL extension are IL-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sergeyol
sergeyol marked this pull request as ready for review October 7, 2026 21:29
Copilot AI balanced review requested due to automatic review settings October 7, 2026 21:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The build and runtime-selection changes are consistent, scoped, and preserve existing platform behavior.

0 open findings

What changed in this PR

Adds native Apple Silicon language-server support while preserving existing x64 behavior.

Changes:

  • Publishes an osx-arm64 self-contained server build.
  • Selects arm64 binaries when VS Code runs natively on Apple Silicon.
File Description
build.ps1 Builds and clears the new arm64 output directory.
vscode-extension/​src/​langserver/​toolsLangServerClient.ts Selects the correct macOS binary based on process architecture.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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 this pull request may close these issues.

2 participants