Repository navigation
cmd/version: print os/version, kernel and bitness - #5204
Conversation
|
v1.55.0-osversion01 prints for me on Linux: on Windows: @ncw @albertony @darthShadow |
|
Great, useful with all those details! |
|
osversion02 |
|
Win10 computer: Arch in WSL: Looks much better! Ship it! :) PS: Wonder why the version "name" is not included, though.. I mean like "1909", "2004", "20H2" etc.. Thats the names that are usually used to describe minimum requirements etc. I don't have the build numbers in my head, so usually have to look them up in wikipedia. Also the version number in os/kernel includes the build number twice and does not include the patch version: "10.0.18363 Build 18363".. From About section in settings panel: From Nothing of this is important, though, I'm just wondering.. May have to have a look into what the gopsutil does some day, if nothing else just to satisfy my curiosity. |
|
Windows 8: Linux - the same:
Also for linux I would expect
I guess on Windows it potters around registry, on Linux - in |
|
Quick retest: Windows 10 output is similar to your Windows 8 output, WSL identical to before: |
ncw
left a comment
There was a problem hiding this comment.
I think this is looking great!
I put an idea for OpenBSD inline
|
|
||
| // GetOSVersion returns OS version, kernel and bitness | ||
| func GetOSVersion() (osVersion, osKernel string) { | ||
| return "OpenBSD", "" |
There was a problem hiding this comment.
You could call syscall.Uname here and return some things out of there.
This should work on OpenBSD I think...
There was a problem hiding this comment.
- The catch is how to test it. I don't have openbsd within reach. We will have to wait for a beta volunteer.
- The main idea was to delegate testing to external package
- uname can usually return kernel and arch but not a logical OS version
There was a problem hiding this comment.
We can try with virtualbox and https://app.vagrantup.com/generic/boxes/openbsd6 but there is no strict guarantee that resulting code won't panic with other actual flavors of OpenBSD.
There was a problem hiding this comment.
I think I can open an upstream issue asking to make gopsutil work on OpenBSD. This OS is not primary for rclone. We can wait.
There was a problem hiding this comment.
They already have PR shirou/gopsutil#965. I'm subscribed on it. We can either put this one on hold waiting for upstream or postpone dependency upgrade to a later PR.
There was a problem hiding this comment.
That sounds fine - it is a minority platform (sorry OpenBSD users) so happy to wait until that PR is merged.
There was a problem hiding this comment.
OK. Will submit another PR when shirou/gopsutil#965 ticks for me.
|
It would be interesting to look at MacOS output. |
|
The Windows 10 "version friendly-name" is easy enough to find from registry key: So instead of:
We could have gotten something like:
But then this requires Windows-specific registry access (if only a few lines), which I know you are not overly exited about 😉, and for me also would just be "nice to have" at this point, so I'm fine with it as is. Regarding:
Just checked the gopsutil src, and it is definitely returning the same So your fix should be safe, and always find match: |
|
v1.55.0-osversion04 includes my build box (go/version is ancient because I build with my desktop (includes update revision github runners (https://github.com/ivandeex/rclone/actions/runs/718936549): ubuntu-latest: windows_amd64 (confirmed having friendly name windows_i386 (notice that EDIT: corrected copy-paste error mac_amd64 (macos-latest) mac_ARM64 |
What an easter miracle - now we do: WSL as before: PS: Is your "windows_i386" example copy/paste error? Identical to your "windows_amd64" example.. Difference is the |
Yes, it was copy/paste error. The original was here https://github.com/ivandeex/rclone/runs/2269099401?check_suite_focus=true
Because P.S. |
|
cmd/version: print os/version, kernel and bitness (#5204) Related to #5121 Note: OpenBSD is a stub yet. This will be fixed when upstream PR gets resolved: |
Related to rclone#5121 Note: OpenBSD is stub yet. This will be fixed after upstream PR gets resolved shirou/gopsutil#993


What is the purpose of this change?
Make
rclone versionprint runtime OS version, kernel and architecture bitness.The implementation is based on https://github.com/shirou/gopsutil (namely gopsutil/host)
The detection on OpenBSD is limited to OS name because base package fails to build on it.
Was the change discussed in an issue or in the forum before?
Related to #5121 (comment)
References:
Checklist
Testing
Instead of writing a unit test which is rather useless in this case, I will publish
beta releases for linux/windows tagged with
v1.55.0-osversionNN.See https://github.com/ivandeex/rclone/releases
Beta testers can download a beta and decide whether
rclone versionoutput feels correct or not.