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

host.PlatformInformation() not precise on Ubuntu #1666

Open
the-hotmann opened this issue Jun 10, 2024 · 3 comments
Open

host.PlatformInformation() not precise on Ubuntu #1666

the-hotmann opened this issue Jun 10, 2024 · 3 comments

Comments

@the-hotmann
Copy link

the-hotmann commented Jun 10, 2024

When I get run:

_, _, host_version, _ := host.PlatformInformation()
fmt.Println(host_version)

On debian I get 11.9 while cat /etc/*release* just shows:

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Which means the tool is more precise than simple shell calls.

But on Ubuntu it gives me back 22.04 While cat /etc/*release* lets me exactly know that it is 22.04.4.
I would like it to display the exact version - including the patch-version - on Ubuntu (22.04.4), not just the Major and Minir version.

I hope this is not too much to ask for :)

Thanks for this nice tool!

@davidnewhall
Copy link
Contributor

The version likely comes from /etc/lsb-release, which doesn't contain the patch revision in a correct format for machines. Changing that output would also break any app that's looking for a specific version that suddenly includes a patch revision.

@sni
Copy link

sni commented Jul 11, 2024

same is true for windows build version. The information would be available from host.platformInformation() but that's not exported as public interface anywhere (anymore).
v3 host.PlatformInformationWithContext() contained the build number. How can i access this information with v4?

@shirou
Copy link
Owner

shirou commented Jul 21, 2024

Sorry for the late reply.

  1. Agree with @davidnewhall, retrieving the patch version of Ubuntu would significantly break compatibility, so I believe a major version upgrade is necessary.

  2. As you mentioned, in the v4 major version upgrade, PlatformVersion() was changed from the Windows build version (e.g., 10.0.22631.3447) to something like 23H2. However, you can still obtain the build version using KernelVersion(). See [v4] Implements v4 for v4.24.0-beta #1629.

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

4 participants