wakatime / wakatime-cli

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

Don't work in Windows 7 #1009

Closed eidoog closed 6 months ago

eidoog commented 6 months ago

wakatime-cli-windows-amd64.exe dont work when run from cmd (Windows 7). Wakatime plugin also dont work in Intellij Idea for this reason. Only working with v1.86.5-alpha.6. But when starting ide, wakatime autoupdated to latest version and dont work.

Related problem: https://github.com/golang/go/issues/64602 Environment: Windows 7 wakatime-cli-windows-amd64.exe v.1.88.1

gandarez commented 6 months ago

Golang 1.21. ended supporting Windows 7 and other versions. Here are the release notes. I'll double check if downgrading to 1.20. won't break the code and 3rd party libraries.

Go 1.20 is the last release that will run on any release of Windows 7, 8, Server 2008 and Server 2012. Go 1.21 will require at least Windows 10 or Server 2016.
alanhamlett commented 6 months ago

You shouldn't be using Windows 7 anymore:

https://en.wikipedia.org/wiki/Windows_7#End_of_support_(after_January_14,_2020)

kuba2k2 commented 3 months ago

Hi Is there any way to stop the plugin from auto-updating? I am unable to use it for 3 months now because of the Golang upgrade. Restoring the previous version solves the issue, however it will auto-update anyway when it gets the chance.

There should really be a switch or a setting to prevent auto-updating. I didn't find such an option, is it available?

To me, saying "you shouldn't use Windows 7" is equivalent to saying "Microsoft shouldn't make Windows 10+ unusable".

alanhamlett commented 3 months ago

For vscode, if you build wakatime-cli from source and manually copy/symlink it to ~/.wakatime/wakatime-cli.exe then it skips updating wakatime-cli. Which IDE are you using? Currently only Vim and VSCode know about local builds from source, but we can add this feature to other IDEs as needed.

kuba2k2 commented 3 months ago

Hi, thanks for the reply. I am using VSCode and IntelliJ (IDEA, CLion and Android Studio). Does that mean that if wakatime-cli is a symlink it won't get updated? (at least in VSCode and Vim)? Do I understand correctly that auto-updating is handled by the IDE plugin, not the CLI itself?

alanhamlett commented 3 months ago

Do I understand correctly that auto-updating is handled by the IDE plugin, not the CLI itself?

Yes, the IDE plugins handle installing and updating wakatime-cli. The wakatime-cli only executes quickly then exits, when the IDE plugins send heartbeats to the WakaTime API.

Does that mean that if wakatime-cli is a symlink it won't get updated?

No, it's normally a symlink except on Windows platforms. It means when running ~/.wakatime/wakatime-cli.exe --version if the output is <local-build> (meaning it was built from source) then it disables updating wakatime-cli. It's easy to build wakatime-cli from source, just download the repo and run make command in a terminal from the repo folder.

I am using VSCode and IntelliJ (IDEA, CLion and Android Studio).

I just released a new version of the IntelliJ plugin that knows about wakatime-cli local builds, so if you build wakatime-cli from source then copy the binary from your build folder into ~/.wakatime/ then it will disable updating wakatime-cli.

kuba2k2 commented 3 months ago

Thank you! It seems to work just fine now. I'm impressed by how quickly you managed to fix it and release an update :smile: Interestingly, the symlink method seemed to work in VSCode, i.e. the CLI was no longer updated. IntelliJ did update it though; with the latest plugin version it's all good now.