dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.71k stars 1.06k forks source link

Empty package ID in message when running `dotnet tool update -g --all` with up-to-date packages #43158

Open DL444 opened 2 months ago

DL444 commented 2 months ago

Describe the bug

When running dotnet tool update -g --all and some packages are already up to date, the message prints an empty ID.

Tool '' is already installed.

This is a follow-up issue blocked by #42598. That issue must be addressed before the problematic code path for this issue can be reached.

To Reproduce

(Assuming #42598 already fixed)

  1. Install any global dotnet tool. For example: dotnet tool install csharprepl -g
  2. Immediately perform full global tools update: dotnet tool update -g --all
  3. Observe that the CLI prints a message with an empty package ID in it

Exceptions (if any)

Not applicable

Analysis

This is caused by a new optimization where up-to-date packages are no longer reinstalled, introduced by 4a4823d8b9f0f7b3610f47af4ddda82edb6a21e2. The newly added message is formatted with the package ID supplied in the command line, which would be null if --all is supplied.

Further technical details

.NET workloads installed: Configured to use loose manifests when installing new manifests. [aspire] Installation Source: VS 17.11.35222.181, VS 17.12.35209.166 Manifest Version: 8.0.1/8.0.100 Manifest Path: E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.1\WorkloadManifest.json Install Type: FileBased

Host: Version: 9.0.0-rc.1.24414.5 Architecture: x64 Commit: static

.NET SDKs installed: 10.0.100-dev [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 9.0.0-preview.7.24406.2 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 9.0.0-rc.1.24414.4 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.0 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 9.0.0-preview.7.24405.7 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 9.0.0-rc.1.24412.13 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 9.0.0-rc.1.24414.5 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 9.0.0-preview.7.24405.2 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.WindowsDesktop.App]

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

Environment variables: DOTNET_ROOT [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet]

global.json file: Not found

baronfel commented 2 days ago

I can't repro this on .NET 9 rc2:

> dotnet tool update -g --all
Tool 'binlogtool' is already installed.
Tool 'complog' is already installed.
Tool 'dafny' is already installed.
Tool 'dotnet-dump' is already installed.
Tool 'dotnet-ef' is already installed.
Tool 'dotnet-outdated-tool' is already installed.
Tool 'dotnet-trace' is already installed.
Tool 'fantomas-tool' is already installed.
Tool 'fsautocomplete' is already installed.
Tool 'gti' is already installed.
Tool 'ionide.projinfo.tool' is already installed.
Tool 'microsoft.dotnet.mage' is already installed.
Tool 'microsoft.visualstudio.slngen.tool' is already installed.
Tool 'microsoft.web.librarymanager.cli' is already installed.
Tool 'sayedha.blackjack.cli' is already installed.
Tool 'sayedha.roulette.cli' is already installed.
Tool 'sayedha.template.command' is already installed.
Tool 'swashbuckle.aspnetcore.cli' is already installed.
Tool 'telplin' is already installed.
Tool 'upgrade-assistant' is already installed.

@DL444 did this get fixed somewhere?

DL444 commented 2 days ago

@baronfel The issue is already fixed for .NET 8 and .NET 9 RC 2 by #43157. I believe it's still open only to track merging into main.

baronfel commented 2 days ago

@marcpopMSFT can we schedule some time for the team to check that nothing got left from RC2 and GA unmerged to main?

marcpopMSFT commented 2 days ago

@baronfel we have a large backlog of work that hasn't made it to main yet. https://github.com/dotnet/sdk/pull/44212

@joeloff is this still blocked by the Wix changes for arcade?