stanislav-tkach / os_info

Rust library to detect the operating system type
MIT License
175 stars 52 forks source link

Support for SemVer pre-releases #355

Closed ydirson closed 1 year ago

ydirson commented 1 year ago

semver allows versions to include a "pre-release" (eg. -beta), and that would be useful for FreeBSD versioning, which has not only -RC1 and such, but also uses -RELEASE for stable versions, which unfortunately all end up as Version::Custom today.

I understand that adding an optional component is likely to have some impact, switching enum type from a tuple to a struct with an Option. This also raises the issue that many OS versions indeed are not strictly SemVer-compliant (eg. no patchlevel or even no minor version), and this could be a path towards supporting them more exactly.

Note SemVer also has a concept of "build metadata" (eg. +20130313144700), but I'm not sure how much that one would be useful here.

ydirson commented 1 year ago

Closing this in favor of this suggestion for #280