Skip to content
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

Please prefer file_release over lsb_release #319

Open
davidkna opened this issue Jul 24, 2022 · 2 comments
Open

Please prefer file_release over lsb_release #319

davidkna opened this issue Jul 24, 2022 · 2 comments

Comments

@davidkna
Copy link
Contributor

Many distributions don't seem to distribute lsb_release binaries by default, and reading a file should be faster than executing an external binary. In addition, file_release works better in some situations: lsb_release detects Fedora WSL remix as Linux, whereas file_release picks up Fedora. Now that file_release hopefully works reliably, is lsb_release needed at all?

@martintc
Copy link
Contributor

martintc commented Jul 27, 2022

Will investigate this. Linux has been a little tricky and I have not sit down to solve some of the issues. But yea, relying on lsb_release is an issue because if someone doesn't have that package installed on their distro (and as you mentioned, many don't distribute in their 'base'), it leads to garbage results. If we can cut down our external dependencies that we can't control through cargo, it should be avoided at all cost. That is at least my view.

Which is really an issue as os_info is a library and from what I've seen using os_info as a library in comtrya, it can be hard to tease out the issue on a platform is lack of lsb_release as a source of a bug in a caller on os_info.

@stanislav-tkach
Copy link
Owner

@martintc

if someone doesn't have that package installed on their distro (and as you mentioned, many don't distribute in their 'base'), it leads to garbage results

There should be no garbage results, because in that case the library falls back to using the release file.

@davidkna
That makes sense, though I prefer conservatively not remove the lsb_release usage, at least not immediately. Changing the priority should be fine, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants