-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version number sorting #2840
Comments
Sorry I closed this issue because I thought that I posted it in wrong repo. |
Just my two cents here - I don't believe this is truly a bug in the sorting. Because they use the format of --, the day is the first part of the version compared. So, when looking at it as a version, '08' is higher than '01', and it makes sense that 08-03-2022 would be deemed newer. Even PowerShell uses this logic when comparing the two -
In fact, if the publisher were to have a release on December 31st, then versions would only be detected as newer if they were released on December 31st of the following year, since 31-12-XXXX would be greater than any other combination of day and month possible. I think the primary issue here is the publisher is not using a semantic version, meaning that standard version comparisons will almost always fail. You can see they get around this in their GitHub releases by using the year, then the month, then the day. This is partially why we can use the GitHub tag as the Marketing Version over at winget-pkgs - since YYYY-mm-dd will always be increasing. I've filed an issue on their GitHub repo to switch the order of their versioning in the registry fontforge/fontforge#5178 |
Yes, their versioning which is reported to windows is honestly kind of dumb. If they really want do use date as version number they should use date according to ISO 8601. Which was created with this in mind yet some developers ignore it. |
Perhaps this issue should be kept open - there may be ways for version parsing to be improved. It may be possible to attempt parsing versions as dates if they are of the format XX-XX-XXXX |
OK I'll leave it open than. |
I'll never understand why is somebody opting to use date in regional format as version number instead of standardized format. |
And honestly I need to stop using |
I changed it to a feature since the client is "doing the right thing". We can consider other mechanisms, but semantic versioning is a best practice. |
Thanks @denelon, best guess is FontForge may have adapted a shortened format of yyyy-mm-dd format as that seen in webpages like this: https://sourceforge.net/p/fontforge/git/ci/master/tree/ |
I think you're missing a key factor. YYYYMMDD would work and would sort properly since it would be strictly increasinc. FontForge is writing DDMMYYYY as its version in the registry, which is not strictly increasing |
Yes, I think one option could be to have a "custom version format" type of enumeration to inform the client of how to "reason" about versioning. This also becomes an order of magnitude harder when the versioning schema changes for a package. We will clearly need a specification for this type of feature. |
I really do not see, how WinGet should be responsible for all potenital versioning schemas out there:
how is Winget suppose to understand all these and there already exist an path forward with the current manifest:
I have analysed the versioning in WinGet in some details here: #3073 (comment) The only thing missing would be to document this approach properly and communicate that documentation! *) Well, I doubt, anyone would use GUID's as their versioning strategy but I added that one to hit my point: there will always be the one strategy nobody has thought about before! |
^ That is exactly the point. One of the core tenets of Winget has always been to meet developers where they are. There are many applications out there which do not use semVer, and I actually have seen applications where the version is the first few characters of the commit hash. WinGet should have some way to gracefully handle these weird scenarios, and currently it does not. However, I do think that there is a "quick" fix for this that would allow WinGet to have its own internal version number association for packages with weird versions - Either way, it doesn’t hurt to keep this issue open as a potential considerarion until there is a formal decision from the engineering team that this is something which they are choosing not to implement |
[Policy] Area-Output |
Brief description of your issue
If version number of package contains dashes, winget will sort it incorrectly and will think that for example older version is latest instead of latest version.
This is issue with temporal version according to @stephengillie in this PR microsoft/winget-pkgs#93519 (comment)
FontForge.FontForge package is affected by this issue because it's versions are looking like this (08-03-2022, 01-01-2023, etc.) This can be seen in this snapshot of repo https://github.com/microsoft/winget-pkgs/tree/473159531f3618f21a7b89151fb181d0632c59df/manifests/f/FontForge/FontForge
Steps to reproduce
Install latest fontforge.
List update using winget upgrade
It'll show version 08-03-2022 as latest despite having version 01-01-2023.
Expected behavior
Running winget upgrade should not show that update is available if version 01-01-2023 is already installed
Actual behavior
Running winget upgrade shows that upgrade is available as version 08-03-2022.

Environment
The text was updated successfully, but these errors were encountered: