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

Try to find the .NET SDK PATH on Mac if it Installs to Unexpected Loc #1884

Merged
merged 3 commits into from
Jul 16, 2024

Conversation

nagilson
Copy link
Member

Our highest failure for .NET SDK Installs on Mac only is that the InstallationValidator which checks the hard-coded expected path of Installation does not find .NET in the expected location. Unfortunately, nobody has reported this so we can't get more info from them.

To get to this point in the code of Validation, everything has to have succeeded, including the installer only returning and exiting 0, which it would only do upon installation success.

I'm guessing there is some undocumented case where the .NET SDK is installed to a different location, but I couldn't find where.

Here is our path check. https://github.com/dotnet/vscode-dotnet-runtime/blob/main/vscode-dotnet-runtime-library/src/Acquisition/WinMacGlobalInstaller.ts#L239

According to the installer source code and our documentation, it should only install to this location or with x64 during emulation.

<PkgInstallDirectory>/usr/local/share/dotnet</PkgInstallDirectory>
      <x64EmulationPkgInstallDirectory>/usr/local/share/dotnet/x64</x64EmulationPkgInstallDirectory>

The 64 directory however, is only for when you install a 64-bit SDK on an ARM Mac. We wouldn't expect this to happen because we only install the SDK that matches os.platform(), so we should never install an x64 SDK on an ARM machine.

I'm curious to see where this path is and this will also help us track that. It's a bit of a hack, but I think it will have the desired outcome.

…ation

Our highest failure for .NET SDK Installs is that the `InstallationValidator` which checks the hard-coded expected path of Installation does not find .NET in the expected location. Unfortunately, nobody has reported this.

To get to this point in the code of `Validation`, everything has to have succeeded, including the installer only returning and exiting 0, which it would only do upon installation success.

I'm guessing there is some undocumented case where the .NET SDK is installed to a different location, but I couldn't find where.

Here is our path check. https://github.com/dotnet/vscode-dotnet-runtime/blob/main/vscode-dotnet-runtime-library/src/Acquisition/WinMacGlobalInstaller.ts#L239

According to the installer source code and our documentation, it should only install to this location or with x64 during emulation.
```
<PkgInstallDirectory>/usr/local/share/dotnet</PkgInstallDirectory>
      <x64EmulationPkgInstallDirectory>/usr/local/share/dotnet/x64</x64EmulationPkgInstallDirectory>
```

The 64 directory however, is only for when you install a 64-bit SDK on an ARM Mac. We wouldn't expect this to happen because we only install the SDK that matches os.platform(), so we should never install an x64 SDK on an ARM machine.

I'm curious to see where this path is and this will also help us track that.
It's a bit of a hack, but I think it will have the desired outcome.
@nagilson nagilson enabled auto-merge (squash) July 16, 2024 23:10
@nagilson
Copy link
Member Author

btw, we dont use --list-sdks to verify the SDK because we dont want to trigger the 1st run sentinel if the user hasn't used the SDK yet.

@nagilson nagilson merged commit 22b1065 into dotnet:main Jul 16, 2024
9 checks passed
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