wakatime / wakatime-cli

Command line interface used by all WakaTime text editor plugins
https://wakatime.com/plugins
BSD 3-Clause "New" or "Revised" License
277 stars 41 forks source link

NixOS is recongnized as Unknown OS #885

Closed Freed-Wu closed 1 year ago

Freed-Wu commented 1 year ago

Expected behavior (what should have happened):

Actual behavior (what went wrong):

Screenshot from 2023-05-24 00-35-27

Environment:

Logs:

{"caller":"cmd/heartbeat/heartbeat.go:140","file":"/run/user/1000/firenvim/github.com_wakatime-wakatime-cli-issues-new_TEXTAREA-id-issue-body_2023-05-23T16-35-07-898Z.txt","func":"heartbeat.SendHeartbeats","level":"warning","message":"Too many recent heartbeats.","now":"2023-05-24T00:35:10+08:00","os/arch":"unset/unset","plugin":"vim/801 neovim-wakatime/10.0.0","time":1684859708,"version":"1.73.0"}
Freed-Wu commented 1 year ago

Maybe this is the bug of NixOS. (about uname?) I'll report to them https://github.com/NixOS/nixpkgs/issues/233647

gandarez commented 1 year ago

@Freed-Wu paste the output for ~/.wakatime/wakatime-cli-linux-amd64 --user-agent (or the correct binary for your installation)

Freed-Wu commented 1 year ago
$ wakatime-cli --user-agent
wakatime/1.73.0 (linux-6.3.3-unknown) go1.20.4 Unknown/0
alanhamlett commented 1 year ago

In your log the os/arch is unknown:

"os/arch":"unset/unset"

We use uname to detect the OS so it's probably related to that Nix issue:

https://github.com/wakatime/wakatime-cli/blob/849d5c5d9dc8a5786b6a07ee0fe9a88055205b2d/pkg/system/system_linux.go#L20

Freed-Wu commented 1 year ago

This problem seems to disappear. Thanks!