dotnet / installer

.NET SDK Installer
https://github.com/dotnet/sdk
1.27k stars 446 forks source link

Why is the arm64 sdk found on x64 machines? #14421

Open Varorbc opened 2 years ago

Varorbc commented 2 years ago

Description

Why is the arm64 sdk found on x64 machines?

Reproduction Steps

dotnet --info

Expected behavior

arm64 should not be found

Actual behavior

.NET SDK:
 Version:   7.0.100-rc.2.22426.5
 Commit:    2d1a4de6b2

运行时环境:
 OS Name:     Windows
 OS Version:  10.0.22621
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.100-rc.2.22426.5\

Host:
  Version:      7.0.0-rc.1.22422.12
  Architecture: x64
  Commit:       ef077d0b58

.NET SDKs installed:
  3.1.420 [C:\Program Files\dotnet\sdk]
  5.0.408 [C:\Program Files\dotnet\sdk]
  6.0.400 [C:\Program Files\dotnet\sdk]
  7.0.100-rc.2.22426.5 [C:\Program Files\dotnet\sdk]
  8.0.100-alpha.1.22428.3 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.0-rc.2.22424.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.0-rc.1.22422.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.0-rc.2.22424.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  arm64 [C:\Program Files\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  E:\Projects\HelloNet\global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

image

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

dotnet-issue-labeler[bot] commented 2 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

ghost commented 2 years ago

Tagging subscribers to this area: @vitek-karas, @agocke, @vsadov See info in area-owners.md if you want to be subscribed.

Issue Details
### Description Why is the arm64 sdk found on x64 machines? ### Reproduction Steps `dotnet --info` ### Expected behavior arm64 should not be found ### Actual behavior ``` .NET SDK: Version: 7.0.100-rc.2.22426.5 Commit: 2d1a4de6b2 运行时环境: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.100-rc.2.22426.5\ Host: Version: 7.0.0-rc.1.22422.12 Architecture: x64 Commit: ef077d0b58 .NET SDKs installed: 3.1.420 [C:\Program Files\dotnet\sdk] 5.0.408 [C:\Program Files\dotnet\sdk] 6.0.400 [C:\Program Files\dotnet\sdk] 7.0.100-rc.2.22426.5 [C:\Program Files\dotnet\sdk] 8.0.100-alpha.1.22428.3 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.0-rc.2.22424.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0-rc.1.22422.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.0-rc.2.22424.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Other architectures found: arm64 [C:\Program Files\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation] x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation] Environment variables: Not set global.json file: E:\Projects\HelloNet\global.json Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download ``` ![image](https://user-images.githubusercontent.com/5714438/187572659-10e6ad9d-1eeb-4243-b45a-692c44eaecba.png) ### Regression? _No response_ ### Known Workarounds _No response_ ### Configuration _No response_ ### Other information _No response_
Author: Varorbc
Assignees: -
Labels: `area-Host`, `untriaged`
Milestone: -
vitek-karas commented 2 years ago

Side note about the screenshot from registry. The install locations are actually only used from the 32-bit view of the registry. So on x64 OS you need to look at Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions.

@joeloff - this is done by the installer, did we try to fix this so that the installer doesn't write non-sensical info about other architectures? For example on my machine it shows the arm64 to be installed in x86 directory:

  arm64 [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]

Overall this is just confusing - there's definitely non arm64 runtime available on the machine and trying to run arm64 app will fail. But I agree that dotnet --info looks confusing (and in this case it's that there's actually sort of wrong info in the registry).

@elinor-fung should we maybe change what dotnet --info prints out as the location of the registry key? Since now if I run x64 dotnet it prints out registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation] which is technically wrong, since it's actually in registered at [HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\arm64\InstallLocation]

joeloff commented 2 years ago

@vitek-karas the path entry is definitely wrong.

vitek-karas commented 2 years ago

@joeloff do you want to move the bug to the right place then? Since it's really a setup issue, we should not be writing the path there.

joeloff commented 2 years ago

Yeah, move it to installer for now. I suspect though that this is coming from Arcade since there's some built-in templates/tasks that the runtime uses for generating its installers, but at least this way we'll track it and once we've triaged/assigned we can move it to Arcade if necessary.

Varorbc commented 2 years ago

@vitek-karas @joeloff https://github.com/dotnet/runtime/pull/70403

vitek-karas commented 2 years ago

@Varorbc yes - that's what added that section to dotnet --info, but it's reading the info from registry, which is wrong in this case.

marcpopMSFT commented 3 months ago

Old issue triage: We can't reproduce this currently so closing. Ping if you still can.

Varorbc commented 3 months ago

@marcpopMSFT I still reproduced using the 9.0 sdk

Varorbc commented 3 months ago

@marcpopMSFT ping.please reopen

marcpopMSFT commented 3 months ago

Do you have any other SDKs installed as well? A few of us have tried this and don't see arm64 listed. I wonder if something is leftover in your registry from some prior state.

Varorbc commented 3 months ago

This is a list of SDKS I have installed. image What registry information do I need to provide and if so, please let me know.

joeloff commented 1 week ago

Is this an arm64 machine with an x64 install?