dotnet / vscode-dotnet-runtime

VSCode Extension for Installing .NET via VS Code
MIT License
140 stars 267 forks source link

Always installs x64 binaries instead of arm64 for macOS on Apple Silicon #1274

Open daleeidd opened 1 year ago

daleeidd commented 1 year ago

Describe the bug

I am using the Apple Silicon version of VSCode on macOS. It always installs x64 dotnet binaries

Please attach log file(s) here if you have any:

Extension log: DotNetAcquisition-ms-dotnettools.vscode-dotnet-runtime-1692450046294.txt

Dotnet info: dotnetinfo.txt

Reproduction Steps

Expected behavior It installs the arm64 binary of .dotnet.

Further technical details

Other Notes

All the other C# extensions install as the darwin-arm64 version (has the suffix).

As a workaround I had been symlinking a local install of .dotnet which has the arm64 binaries. I only installed them for this. But adhoc solution is fragile.

baronfel commented 1 year ago

Thanks for the report! Do you have an arm64 install of dotnet installed globally on your system? If so you can use these troubleshooting steps to point to that installation while we triage the issue? That would at least keep you from having to maintain a symlink.

baronfel commented 1 year ago

Also, can you please comment what the output of uname -m is on your machine? The install scripts use this to determine which matching .NET payload to download.

daleeidd commented 1 year ago

Thanks for the report! Do you have an arm64 install of dotnet installed globally on your system? If so you can use these troubleshooting steps to point to that installation while we triage the issue? That would at least keep you from having to maintain a symlink.

Thanks. I did try that before but another bug (Unity extension shows the wrong identifier) caused that not to work but I got it working this time round.

Also, can you please comment what the output of uname -m is on your machine? The install scripts use this to determine which matching .NET payload to download.

Certainly (and looks like this is the problem):

uname -m
x86_64

uname -a
... RELEASE_ARM64_T8103 x86_64 i386 Darwin

I looked into this further and this is because my default shell is x64 (installed with home-brew from old x64 machine). After reinstalling home-brew and the default shell the uname is correct and solved the problem with the arm64 binaries not installing.

Feel free to close if you do not want to catch this edge case.

baronfel commented 1 year ago

Thanks for the confirmation @daleeidd - how frequently do you think this will be a problem for m1/m2 users? Is this an artifact of general support for arm64 lagging behind x64 for the software you use, or is it more like a common occurrence that you'd expect many m1/m2 users to hit?

daleeidd commented 1 year ago

In my case I migrated my Intel Mac over to M1 several months ago but postponed reinstalling Homebrew and then forgot about it. Support for universal/arm64 binaries is pretty good now so I would say rare occurrence.