Open rucker opened 2 years ago
How did you modify the PATH variable?
It looks like the CLI uses a different environment than the UI.
https://www.bounga.org/tips/2020/04/07/instructs-mac-os-gui-apps-about-path-environment-variable/
Have you tried setting the PATH in /etc/launchd
?
EDIT: In the comments someone says that it no longer works :/
I am setting my PATH
in my .bashrc
. From what I've read, exposing user env vars to GUI applications on macOS is a nontrivial problem with a lot of potential solutions (depending on the version -- as you mentioned, launchd
used to be one possibility but this is no longer the case).
At any rate, unless you want this thumbnailer script to go looking in known locations like Homebrew's bin dir that aren't on the default PATH
(I understand if you don't), it seems to me that this is more of a system configuration issue.
Here are some possible solutions for anyone else facing this situation:
mpv
as shown in the OP above.Unless there are other possibilities I'm not thinking of, you can probably close this issue.
So none of the possibilities in [2.] work? launchctl setenv PATH $PATH
looked promising.
I could also add an option for setting the path to mpv.
The same problem. My workaround here: https://github.com/TheAMM/mpv_thumbnail_script/issues/61
So none of the possibilities in [2.] work?
launchctl setenv PATH $PATH
looked promising. I could also add an option for setting the path to mpv.
I haven't tried everything in that SO thread, but launchctl setenv PATH $PATH
unfortunately did not do the trick. I verified that the path is correct via launchctl getenv PATH
but it had no apparent effect -- launching MPV after setting this resulted in the thumbnailer job failing as before. I agree it looked promising though!
@marzzzello @SemperPeritus Please have a look at #39, which I think will resolve this.
Description of the bug Thumbnailer job will fail to invoke
mpv
on macOS which causes the entire job to fail. Relevant log output is:To Reproduce Steps to reproduce the behavior:
bin
dir to$PATH
autogenerate=true
in your conf file.Expected behavior Thumbnailing job completes normally
Environment
The Workaround I noticed that the issue did not occur when I ran
mpv
on the CLI. Through some testing according to #16, I verified that the issue is that thempv_command
built by the script fails to invokempv
. I worked around this by modifying the relevant line in the server to use the absolute path tompv
and everything works as expected. Either the homebrew bin path (which is a symlink to the application bundle, below) or the path to the binary in the app bundle worked just fine.As shown above, the Homebrew path
/opt/homebrew/bin
is on my user's$PATH
. Adding the appropriate path to/etc/paths
before starting MPV had no effect.Recommendations From a look through the code, it seems as though the server
ExecutableFinder
, which loads the user's environment to search forffmpeg
, could be used to findmpv
as well.