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

[Breaking change] Stop adding C:\Program Files(x86)\dotnet to the path on x64 and Arm64 machines #22030

Closed
richlander opened this issue Oct 14, 2021 · 2 comments
Labels
Area-CLI untriaged Request triage from a team member
Milestone

Comments

@richlander
Copy link
Member

richlander commented Oct 14, 2021

[Breaking change] Stop adding C:\Program Files(x86)\dotnet to the path on x64 and Arm64 machines

Proposal: .NET Installers only add the .NET global install location to the PATH if the architecture of the .NET build and machine match.

Examples:

  • The x64 .NET build will add its location to the PATH when installed on an x64 machine/operating system.
  • A 32-bit x86 .NET build will not add its location to the PATH when installed on that same machine.
  • Order of installs does not matter.

Motivation for break:

  • Adding multiple builds of .NET to the PATH is incoherent, results in bad UX, and is difficult to explain.
  • We have already started down this direction with x64 on Arm64. It makes sense to make the product consistent, by repeating the pattern with x86 on x64 and x86 on Arm64.

Context

When you install .NET, the installer adds the install location to the PATH environment variable. This behavior is sound and enables the OS to find dotnet when you use it. We build multiple .NET for multiple architectures (x86, x64, ...). In some cases, an OS supports multiple architectures and then we need a plan for how multiple .NET locations in the PATH works. In short, it doesn't work well. Going forward, we should only ever add the OS native-architecture .NET install location to the PATH. We already started doing that on Apple M1 (Arm64) machines (we only add the Arm64 .NET to the PATH, not the x64 version). We need to repeat this pattern with Windows now, with the 32-bit .NET build.

Relevant: https://twitter.com/dotMorten/status/1448403460756361220.

UX for x86 32-bit installs

This change means that users that rely on the 32-bit builds (either exclusively or otherwise) may experience a regression in behavior. By default, the 32-bit dotnet will not be available. This is already the case for users who install both the 64-bit and 32-bit build on Windows x64 (possibly by virtue of installing Visual Studio). If users solely depend on the 32-bit runtime, then they probably won't see a regression in behavior. If they rely on the 32-bit SDK, then they will. We have already rationalized about this experience with x64 on Arm64. See the "Better x64 dotnet UX" section in Supporting .NET with x64 emulation on Arm64 for a discussion of how to approach a .NET build that is not available in the PATH by default.

@richlander richlander added this to the 7.0.1xx milestone Oct 14, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-CLI untriaged Request triage from a team member labels Oct 14, 2021
@richlander richlander changed the title [Breaking change] Stop adding C:\Program Files(x86)\dotnet to the path on x64 machines [Breaking change] Stop adding C:\Program Files(x86)\dotnet to the path on x64 and Arm64 machines Oct 14, 2021
@ericstj
Copy link
Member

ericstj commented Oct 14, 2021

https://twitter.com/dotMorten/status/1448403460756361220

While related that's a different bug. You can't fix that bug by removing path from x86 in 7.0. You would have to go back and remove the x86 PATH entry from every version of dotnet that was ever shipped, and also fix the ref counting issue that would abandon the x86 PATH entry on uninstall.

We fixed the issue mentioned in that tweet already, and what I believe is the primary issue that caused folks to notice the x86 PATH entry at all, by fixing the reordering of PATH on upgrades.

The purpose of this issue is to change the product to prevent accidentally getting a non-native dotnet on the PATH from a clean install. That can happen today if you install x86 before x64 or ARM64. That is the reason we still want to do this even with the reordering fix.

@richlander
Copy link
Member Author

This was resolved: dotnet/runtime#69902

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CLI untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

2 participants