DevToys-app / DevToys

A Swiss Army knife for developers.
https://devtoys.app/
MIT License
26.94k stars 1.45k forks source link

winget version not matching with internal version #1257

Closed masterflitzer closed 3 months ago

masterflitzer commented 3 months ago

Current behavior

when installing devtoys via winget the version tagged 2.0.2 installs the version 2.0-preview.2, this results in the same version always being offered as update in winget (infinite upgrade loop when running winget upgrade)

the problem is that the package manager version (2.0.2) doesn't match with the internal version (2.0-preview.2):

How to reproduce it (as minimally and precisely as possible)

powershell:

winget install DevToys-app.DevToys
winget upgrade
# devtoys is always offered as upgrade, so this can be repeated infinitely:
winget upgrade DevToys-app.DevToys

Expected behavior

winget should upgrade to the latest version and then stop offering updates until a new one is released

Screenshots

notice how version (2.0-preview.2) and available (2.0.2) columns differ even though the latest version is installed

~
❯ winget upgrade
Name                                  Id                  Version       Available
---------------------------------------------------------------------------------
DevToys Preview version 2.0-preview.2 DevToys-app.DevToys 2.0-preview.2 2.0.2
1 upgrades available.
6 package(s) have pins that prevent upgrade. Use the 'winget pin' command to view and edit pins. Using the --include-pinned argument may show more results.

~
❯

Workaround

No response

Affected platforms

No response

Affected DevToys kind

DevToys (app with GUI)

DevToys Version

Version 2.0-preview.2

Relevant Assets/Logs

relevant github comments:

veler commented 3 months ago

Hi @stephengillie, I hope it's OK to ping you here. I'm wondering if you have any recommendation on what to do with such issue. Thank you very much in advance for your help :-)

stephengillie commented 3 months ago

Yes. The error is that the PackageVersion is 2.0.1 but should be 2.0-preview.1.

veler commented 3 months ago

Yes. The error is that the PackageVersion is 2.0.1 but should be 2.0-preview.1.

  • This happened again with 2.0.2 and 2.0-preview.2. This is because these are the bits that the package manager uses to match repo data with Registry data.
  • In https://github.com/microsoft/winget-pkgs/pull/156567#issuecomment-2166560844, the version in the application was fixed, but this didn't "backpropagate" into the manifest.
  • If the application matches the Registry, then a DisplayVersion isn't necessary and the PackageVersion should match both.

Thank you very much! I just released an update and opened a PR here: https://github.com/microsoft/winget-pkgs/pull/159727 Hopefully it's well done this time. Please let me know if you find anything wrong. Thank you again for your help, I really appreciate a lot!

masterflitzer commented 3 months ago

@veler after the changes it works perfectly now, thank you very much for jumping through all the hoops to make devtoys available on winget, i very much appreciate it