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

RFC: wakatime-find-binary improvement #72

Open
pataquets opened this issue Aug 17, 2023 · 4 comments
Open

RFC: wakatime-find-binary improvement #72

pataquets opened this issue Aug 17, 2023 · 4 comments

Comments

@pataquets
Copy link

pataquets commented Aug 17, 2023

I need to look for Wakatime's cli binary in ~/.local/bin. I'm aware I can manually configure it via wakatime-cli-path (my current workaround), but I was expecting it to work out of the box, as it's a commonly used directory alternative.

As per XDG Base Directory Specification, ~/.local/bin may contain user binaries.
Also, ~/bin is also a common binary location (at least in Ubuntu's default .profile: filesystem - What's the purpose of $HOME/bin directory? - Ask Ubuntu)

Checking the code, neither of the above paths is checked. At first I thought on adding them and sending a PR. On second thought, I wonder why is not executable-find being used. Maybe some function's built-in behavior is not desired.

Before going further, some feedback would be appreciated.

@pataquets
Copy link
Author

@alanhamlett ping in case issue notification went unnoticed.

@gandarez
Copy link
Member

@pataquets you can create a symlink for it?

@pataquets
Copy link
Author

@pataquets you can create a symlink for it?

Sure I can, @gandarez. Thanks for the suggestion. But that would be also a workaround similar to the one I'm describing in my post.

However, the point of the issue is to get feedback on a more convenient (ie. no-user-workarounds-required) solution by improving the code robustness, as also described in the issue. Just checkin' to make sure nobody wastes time, if they feel like take a stab at it (which could be myself, indeed).

[A few seconds later, after checking @gandarez's profile and realizing it's a WakaTime org member... 😄]
Thanks again for the workaround. Any thoughts on the issue proposals/doubts? Is the proposed fix acceptable?

@alanhamlett
Copy link
Member

I wonder why is not executable-find being used

Most likely because I'm not very experienced in Emacs Lisp. The convention in other WakaTime plugins is downloading wakatime-cli to ~/.wakatime/wakatime-cli-<os>-<arch>[.exe] then creating a symlink from ~/.wakatime/wakatime-cli to the platform binary. That's because some plugins are limited, or hang when detecting the platform, so it's more reliable for plugins to just always use the hard-coded path ~/.wakatime/wakatime-cli.

For wakatime-mode, if executable-find is better we can switch to using that after checking the common locations.

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