unixorn / lima-xbar-plugin

xbar/Swiftbar plugin to control lima-vm
Apache License 2.0
116 stars 12 forks source link

FileNotFoundError: No such file or directory: '/usr/local/bin/limactl' #24

Closed buzzsurfr closed 3 years ago

buzzsurfr commented 3 years ago

I'm getting the following error in xbar:

 [2021-10-09 09:05:07,468][    INFO][lima-plugin:543 -                 main() ] argv[0] ./lima-plugin
🐋 🏃 | color=#29cc00
---
Traceback (most recent call last):
  File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 567, in <module>
    main()
  File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 545, in main
    xbarMenu()
  File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 526, in xbarMenu
    aboutMenu()
  File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 418, in aboutMenu
    limaVersion = subprocess.run(
  File "/opt/homebrew/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/opt/homebrew/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/homebrew/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/limactl'

I've tried a few permutations of adding /usr/local/bin and /opt/homebrew/bin to the command, as well as checking environment variables.

Ultimately, I had to symlink lima and limactl into /usr/local/bin. Is this expected, and should this be part of the Makefile?

unixorn commented 3 years ago

This is unexpected. Where are lima and limactl installed on your machine? I can update the path-updater to add more directories when they're present.

buzzsurfr commented 3 years ago

I used homebrew to install, so they’re in /opt/homebrew/bin. What’s odd is those are also in my PATH environment variable.

unixorn commented 3 years ago

Annoyingly gui apps don't inherit your PATH from .zshrc/.bashrc

I'll make prep_environment_for_lima also add /opt/homebrew/bin to $PATH, thanks for letting me know.

unixorn commented 3 years ago

Out of curiosity, are you running on an ARM Mac? My Intel MBP installed brew in /usr/local/bin.

buzzsurfr commented 3 years ago

Yes I am. It also is a corporate MacBook but we don't tend to mess with defaults too much.

unixorn commented 3 years ago

Let me know if you still have issues - #25 should have fixed the issue with /opt/homebrew/bin (and as a bonus, macports' /opt/local/bin).