microsoft / winget-pkgs

The Microsoft community Windows Package Manager manifest repository
MIT License
8.67k stars 4.52k forks source link

search & install for .NET Core is showing and installing preview instead of stable #2053

Closed hangrymuppet closed 4 years ago

hangrymuppet commented 4 years ago

Brief description

I am trying to install or search for .NET Core Stable using the following commands,

Expected behavior

Display or install dotnet core that corresponds to the latest version in this path, https://github.com/microsoft/winget-pkgs/tree/master/manifests/Microsoft/dotnet

Actual behavior

Shows or installs a preview version from the below path, https://github.com/microsoft/winget-pkgs/tree/master/manifests/Microsoft/dotnetPreview

Multiple search examples shown below,

PS Microsoft.PowerShell.Core\FileSystem::\\tsclient\win-boo> winget search .net
Name              Id                         Version                    Matched
---------------------------------------------------------------------------------
LINQPad           LINQPad.LINQPad            6.8                        Tag: .net
Netron            LutzRoeder.Netron          4.3.3
mpv.net           stax76.mpv.net             5.4.8.0
.NET Core         Microsoft.dotnet           5.0.100-preview.4
.Net Framework    Microsoft.dotNetFramework  4.8
.NET Core Preview Microsoft.dotnetPreview    5.0.100-preview.5.20279.10
Stride            Stride.Stride              4.0.1.0                    Tag: .NET
Unity Hub         UnityTechnologies.UnityHub 2.3.2.0                    Tag: .NET
PS Microsoft.PowerShell.Core\FileSystem::\\tsclient\win-boo> winget search dotnet
Name              Id                         Version                    Matched
---------------------------------------------------------------------------------------
.NET Core         Microsoft.dotnet           5.0.100-preview.4          Moniker: dotnet
.NET Core Preview Microsoft.dotnetPreview    5.0.100-preview.5.20279.10 Command: dotnet
.Net Framework    Microsoft.dotNetFramework  4.8                        Tag: dotnet
reko              uxmal.reko                 0.9.1.0                    Tag: dotnet
Stride            Stride.Stride              4.0.1.0                    Tag: dotnet
Unity Hub         UnityTechnologies.UnityHub 2.3.2.0                    Tag: dotnet
PS Microsoft.PowerShell.Core\FileSystem::\\tsclient\win-boo> winget search Microsoft.dotnet
Name              Id                        Version
----------------------------------------------------------------------
.NET Core         Microsoft.dotnet          5.0.100-preview.4
.Net Framework    Microsoft.dotNetFramework 4.8
.NET Core Preview Microsoft.dotnetPreview   5.0.100-preview.5.20279.10
PS Microsoft.PowerShell.Core\FileSystem::\\tsclient\win-boo> winget search --id=Microsoft.dotnet
Name              Id                        Version
----------------------------------------------------------------------
.NET Core         Microsoft.dotnet          5.0.100-preview.4
.Net Framework    Microsoft.dotNetFramework 4.8
.NET Core Preview Microsoft.dotnetPreview   5.0.100-preview.5.20279.10
PS Microsoft.PowerShell.Core\FileSystem::\\tsclient\win-boo> winget search --id=Microsoft.dotnet --exact
Name      Id               Version
--------------------------------------------
.NET Core Microsoft.dotnet 5.0.100-preview.4

Environment

PS Microsoft.PowerShell.Core\FileSystem::\\tsclient\win-boo> winget --info
Windows Package Manager v0.1.41331 Preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.20150.1000
Package: Microsoft.DesktopAppInstaller v1.0.41331.0
megamorf commented 4 years ago

That's definitely odd, I've confirmed the report:

Installation

PS C:\Users\WDAGUtilityAccount> winget --info
Windows Package Manager v0.1.41331 Preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19041.264
Package: Microsoft.DesktopAppInstaller v1.0.41331.0

[output omitted]

PS C:\Users\WDAGUtilityAccount> winget install --id=Microsoft.dotnet --exact
Found .NET Core [Microsoft.dotnet]
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.visualstudio.microsoft.com/download/pr/40dff314-f6c2-4aeb-bfc7-7f89fc8d2b61/79b23dcc8727ab76b7df8872968475fe/dotnet-sdk-5.0.100-preview.4.20258.7-win-x64.exe
  ██████████████████████████████   136 MB /  136 MB
Successfully verified installer hash
Installing ...
Successfully installed!

Info .Net Core

The package metadata does not match the manifest:

PS C:\Users\WDAGUtilityAccount> winget show --id=Microsoft.dotnet --exact
Found .NET Core [Microsoft.dotnet]
Version: 5.0.100-preview.4
Publisher: Microsoft
AppMoniker: dotnet
Description: .NET Core is an open-source, general-purpose development platform. You can create .NET Core apps for Windows, macOS, and Linux for x64, x86, ARM32, and ARM64 processors using multiple programming languages. Frameworks and APIs are provided for cloud, IoT, client UI, and machine learning.
Homepage: https://docs.microsoft.com/dotnet/core/
License: MIT
License Url: https://github.com/dotnet/core/blob/master/LICENSE.TXT
Installer:
  SHA256: 18f46cbf291cf0492a54917378de53236187d957dbc36821992ffa73aeec20a8
  Download Url: https://download.visualstudio.microsoft.com/download/pr/40dff314-f6c2-4aeb-bfc7-7f89fc8d2b61/79b23dcc8727ab76b7df8872968475fe/dotnet-sdk-5.0.100-preview.4.20258.7-win-x64.exe
  Type: Exe

Info .Net Core Preview

Found .NET Core Preview [Microsoft.dotnetPreview]
Version: 5.0.100-preview.5.20279.10
Publisher: Microsoft
AppMoniker: dotnet-preview
Description: Preview version of the .NET Core SDK.
Homepage: https://docs.microsoft.com/dotnet/core/
License: MIT
License Url: https://github.com/dotnet/core/blob/master/LICENSE.TXT
Installer:
  SHA256: da0745fc103336505aaf4dc3dd9b3d3c3e3caab9e9cf4a9da973830409c58aa3
  Download Url: https://download.visualstudio.microsoft.com/download/pr/38c82743-6223-4a51-a424-ac79a4db189b/5c88aa3116df3b81564077fe49a83c7f/dotnet-sdk-5.0.100-preview.5.20279.10-win-x64.exe
  Type: Exe
megamorf commented 4 years ago

The publishing of a preview installer under the Microsoft.dotnet ID was undone in https://github.com/microsoft/winget-pkgs/pull/1301 but subsequent manifest additions (https://github.com/microsoft/winget-pkgs/pull/120, https://github.com/microsoft/winget-pkgs/pull/873, https://github.com/microsoft/winget-pkgs/pull/1763) to the Microsoft/dotnet directory don't seem to have any effect.

PS: shout-out to @felipecassiors, I used a modified version of your SandboxTest script to test this :-)

megamorf commented 4 years ago

Ah, I see what's happening. The 3 .NET Core packages are indeed available but the preview release that was added and removed has a much higher version number than the current stable releases making winget always fall back to it as default version.

@hangrymuppet The current latest stable release can be installed as follows until the metadata issue is fixed:

winget install Microsoft.dotnet --version 3.1.301 --exact
Found .NET Core [Microsoft.dotnet]
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.visualstudio.microsoft.com/download/pr/4e88f517-196e-4b17-a40c-2692c689661d/eed3f5fca28262f764d8b650585a7278/dotnet-sdk-3.1.301-win-x64.exe
  ██████████████████████████████   124 MB /  124 MB
Successfully verified installer hash
Installing ...
Successfully installed!

/cc @denelon @KevinLaMS

felipecrs commented 4 years ago

PS: shout-out to @felipecassiors, I used a modified version of your SandboxTest script to test this :-)

Glad to hear that, but what modification did you need to do?

megamorf commented 4 years ago

@felipecassiors I removed the manifest parts since I only needed the winget cli in the sandbox to test installing a package from the default winget source instead of a local manifest file. It would make sense to make the manifest parameter optional to make the script more flexible.

denelon commented 4 years ago

The manifests were removed from the repository, but they didn't correctly get removed from the source.

peter-dolkens commented 4 years ago

@denelon - this is a good edge-case to consider while you're working on the overall manifest approvals process.

This should behave similar to nuget, where we can have a manifest removed from search/defaults, but if we explicitly request a version, it should remain available for anyone who developed a prior dependency on that version.

Perhaps we can add a flag to the manifest to indicate it should be hidden from the source, instead of removing them from the source via PRs entirely.

denelon commented 4 years ago

@peter-dolkens We have been looking at the options for retaining manifests. One of the challenges we've been facing is whether or not the original binary is available. In some cases, the distribution of packages is restricted (at least for some commercial packages). One of the thoughts is putting additional meta-data in a manifest to indicate that the binary has been removed, or possibly a reason it's no longer supported.

denelon commented 4 years ago

This appears to be resolved now.

PS C:\Users\denelon> winget search Microsoft.dotnet
Name              Id                        Version
----------------------------------------------------------------------
.NET Core         Microsoft.dotnet          3.1.301
.NET Core Preview Microsoft.dotnetPreview   5.0.100-preview.5.20279.10
.Net Framework    Microsoft.dotNetFramework 4.8

We had an issue where the CDN wasn't getting purged under a rebuild scenario. Issue #2274 seems to capture that one.

peter-dolkens commented 4 years ago

@peter-dolkens We have been looking at the options for retaining manifests. One of the challenges we've been facing is whether or not the original binary is available. In some cases, the distribution of packages is restricted (at least for some commercial packages). One of the thoughts is putting additional meta-data in a manifest to indicate that the binary has been removed, or possibly a reason it's no longer supported.

Another issue is binaries that change over time.

Instead of metadata - perhaps an indexing service which removes manifests with expired links would be in order. Once a month, it could validate the hash of the listed download as part of a scheduled build.