cli-lab icon indicating copy to clipboard operation
cli-lab copied to clipboard

'dry-run' and 'remove' report the wrong platform

Open jrdodds opened this issue 3 years ago • 0 comments

Found this issue on a MacBook Pro with an Apple M1 Pro processor, macOS Monterey (v12.2.1), and "dotnet-core-uninstall" version 1.5.0.

With x64 and arm64 versions of dotnet installed, the 'list' command will show both platforms.

The command

dotnet-core-uninstall list

produces the following output:

This tool cannot uninstall versions of the runtime or SDK that are installed using zip/scripts. The versions that can be uninstalled with this tool are:

.NET Core SDKs:
  6.0.102  (arm64)  [Used by Visual Studio for Mac. Specify individually or use —-force to remove]
  6.0.102  (x64)                                                                                  
  6.0.101  (arm64)                                                                                
  6.0.101  (x64)                                                                                  

.NET Core Runtimes:
  6.0.2  (arm64)  [Used by Visual Studio for Mac or SDKs. Specify individually or use —-force to remove]
  6.0.2  (x64)                                                                                          
  6.0.1  (arm64)                                                                                        
  6.0.1  (x64)                                                                                          

Running the dry-run command for --all-lower-patches, the dry-run command shows two lines for the older patch but both lines show "(x64)". My expectation is that one of the reported items is the arm64 variant.

Command:

dotnet-core-uninstall dry-run --all-lower-patches --sdk

Output:

*** DRY RUN OUTPUT
Specified versions:
  Microsoft .NET Core SDK 6.0.101 (x64)
  Microsoft .NET Core SDK 6.0.101 (x64)
*** END DRY RUN OUTPUT

To avoid breaking Visual Studio for Mac or other problems, read https://aka.ms/dotnet-core-uninstall-docs.

Run as administrator and use the remove command to uninstall these items.

Command:

dotnet-core-uninstall dry-run --all-lower-patches --runtime

Output:

*** DRY RUN OUTPUT
Specified versions:
  Microsoft .NET Core Runtime 6.0.1 (x64)
  Microsoft .NET Core Runtime 6.0.1 (x64)
*** END DRY RUN OUTPUT

To avoid breaking Visual Studio for Mac or other problems, read https://aka.ms/dotnet-core-uninstall-docs.

Run as administrator and use the remove command to uninstall these items.

The remove command has the same reporting issue but appears to actual remove the x64 and arm64 items.

Command:

sudo dotnet-core-uninstall remove --all-lower-patches --sdk

Output:

Password:
The following items will be removed:
  Microsoft .NET Core SDK 6.0.101 (x64)
  Microsoft .NET Core SDK 6.0.101 (x64)

To avoid breaking Visual Studio for Mac or other problems, read https://aka.ms/dotnet-core-uninstall-docs.

Do you want to continue? [y/n] y
Uninstalling: Microsoft .NET Core SDK 6.0.101 (x64).
Uninstalling: Microsoft .NET Core SDK 6.0.101 (x64).

Command:

sudo dotnet-core-uninstall remove --all-lower-patches --runtime

Output:

The following items will be removed:
  Microsoft .NET Core Runtime 6.0.1 (x64)
  Microsoft .NET Core Runtime 6.0.1 (x64)

To avoid breaking Visual Studio for Mac or other problems, read https://aka.ms/dotnet-core-uninstall-docs.

Do you want to continue? [y/n] y
Uninstalling: Microsoft .NET Core Runtime 6.0.1 (x64).
Uninstalling: Microsoft .NET Core Runtime 6.0.1 (x64).

Running the list command again after the remove commands shows that the older patch has been removed for both x64 and arm64.

Output:


This tool cannot uninstall versions of the runtime or SDK that are installed using zip/scripts. The versions that can be uninstalled with this tool are:

.NET Core SDKs:
  6.0.102  (arm64)  [Used by Visual Studio for Mac. Specify individually or use —-force to remove]
  6.0.102  (x64)                                                                                  

.NET Core Runtimes:
  6.0.2  (arm64)  [Used by Visual Studio for Mac or SDKs. Specify individually or use —-force to remove]
  6.0.2  (x64)                                                                                          

Checking the appropriate sub-directories of the /usr/local/share/dotnet and /usr/local/share/dotnet/x64 directories confirms that the remove function was performed correctly so this is an issue with the messaging and not the function of the commands.

jrdodds avatar Feb 11 '22 18:02 jrdodds