wbond / packagecontrol.io

The Package Control website
https://packagecontrol.io
Other
111 stars 46 forks source link

Semantic versions are compared as strings for aggregation, notably the pre-release segment #99

Open FichteFoll opened 6 years ago

FichteFoll commented 6 years ago

Apparently, the channel aggregation, which picks the latest releases for each major and the the latest minor releases (with their latest patch release) for inclusion in the distributed channel_v3.json, happens in postgres, where the semantic versions are compared by string and not how semantic versions should be compared. This is noticeable for versions such as 1.0.0-beta.33, which would be errorneously considered smaller than 1.0.0-beta.7.

FichteFoll commented 6 years ago

Just occured again with SublimeLinter, after previously happening for SublimeCodeIntel.

FichteFoll commented 4 years ago

Occured again with JSCustom. As soon as a package reaches 10 in a pre-release identifier, basically.

The workaround is to jump from 9 to 90 instead of 10.

michaelblyons commented 4 years ago

The workaround is to jump from 9 to 90 instead of 10.

Or to start off zero-padding the numbers (but this requires knowing you'll have the problem before getting there).

I also wonder if you can go from 1.0.0-beta.9 to 1.0.0-charlie.10 and use ASCII-incrementing pre-release identifiers each time the integer rolls over.