-
Notifications
You must be signed in to change notification settings - Fork 53
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
Semantic/Custom version confusion #318
Comments
Thank you for the report! I suppose this is a bug. Unfortunately, I won't be able to dig into this in the nearest future - I have recently changed a job, so now it takes most of my time. Though I will still be able to review and merge a fix if you would like to try to deal with this issue. By the way, now I think that the whole semantic/custom approach is unnecessary and only adds complications. I feel like storing a version string as it is would be enough, but changing it is a breaking change. |
I possibly agree, but there might still be value in providing some functions that help inspect OS versions, where just reverting to As a bonus, if we add some of these now, people can switch over to them and then be insulated from a future breaking change to For my own purposes, I mostly just need to test for specific versions because our goal is "On this old LTS? Apply this workaround" so I was thinking of adding something like:
The goal here would be that I could write The drawback of this particular API though is that if people give it
Would you be interested in one of these as a PR? |
Sorry for the late reply and thanks for such a detailed explanation of your use case! I don't see any harm in extending the api in such way. I only have one consideration about additional dependencies. It makes sense to hide the new api under a feature if some "heavy" crates are needed for the implementation. |
There is similar issue with Debian versions as VMs under XCP-ng / Xen. I will need to dig this one. |
When the lsb_release executable is not found the version is taken from /etc/os_release and properly parsed. When it is found, however, the string was essentially not parsed, resulting in only Version::Custom objects to be returned. Calling the proper parsing function does the trick, and Version::Semantic objects get created as expected. The nearly manual handling of "rolling" for lsb_release, however, looks very suspicous, it should likely be folded to Version::from_string() instead. Signed-off-by: Yann Dirson <[email protected]>
Linux/lsb_release: parse version string (#318)
I haven't fully verified this is reproducible yet.
I think what I'm seeing is that:
Semantic(18, 4, 0)
as the detected versionCustom("18.04")
Could this be the presence/absence of the
lsb_release
mechanism working? Looks like that might reliably returnCustom
: https://github.com/stanislav-tkach/os_info/blob/master/os_info/src/linux/lsb_release.rs#L14 but then thefile_release
mechanism will try to parse: https://github.com/stanislav-tkach/os_info/blob/master/os_info/src/version.rs#L40Should
os_info
include a "version comparison" function with appropriate hacks to make this more reliable? Or at least... have I missed documentation about how to reliably detect a version? Or is this just a bug?The text was updated successfully, but these errors were encountered: