yqrashawn / GokuRakuJoudo

config karabiner with ease
GNU General Public License v3.0
1.16k stars 121 forks source link

Hardcoded path to joker fails on Apple M1 Silicon #109

Closed Dimentium closed 3 years ago

Dimentium commented 3 years ago
❯ goku
Exception in thread "main" java.io.IOException: Cannot run program "/usr/local/opt/joker/bin/joker": error=2, No such file or directory

cause of

❯ which joker
/opt/homebrew/bin/joker

I found similar issues description

According to https://docs.brew.sh/Installation, /usr/local is for Intel binaries, /opt/homebrew for ARM.

here stackexchange

yqrashawn commented 3 years ago

what does brew --prefix joker show on your mac?

Dimentium commented 3 years ago
brew --prefix joker
/opt/homebrew/opt/joker
yqrashawn commented 3 years ago

updates: Seems graalvm don't support cross compilation yet. I'll have to use github actions which I'm not familiar with.


Seems the project runs out of Travis CI credits. Circle CI doesn't provide free macos image. I need time to investigate cross compile with graalvm.

MuhammedZakir commented 3 years ago

Is there a reason for hardcoding path? Isn't shell/sh joker "--lint" path better than hardcoding joker's path? The current paths do not take account of user installing joker with other means. E.g. downloading binary.

P.S. if you are hardcoding user paths. isn't /usr/local/bin/joker a better one? Brew also put symlinks of apps there.

yqrashawn commented 3 years ago

There are problems getting the right PATH when launch gokuw with brew service , which uses macos launchagents.

I just fixed it using homebrew formula api.

https://apple.stackexchange.com/questions/364973/how-can-i-use-home-or-environment-variable-in-plist-file-of-launchdaemons?noredirect=1&lq=1

yqrashawn commented 3 years ago

~fixed in 0.3.7~ The binary won't work.

Dimentium commented 3 years ago

0.3.6 works perfect on both devices now!

M1:

❯ md5 (which goku)
MD5 (/opt/homebrew/bin/goku) = e9173da35f21cb8cc7fa087fa1436e25
~
❯ goku -c ~/.config/karabinerM1.edn
Done!

Intel:

❯ md5 (which goku)
MD5 (/usr/local/bin/goku) = e9173da35f21cb8cc7fa087fa1436e25
~
❯ goku -c ~/.config/karabiner.edn
Done!
yqrashawn commented 3 years ago

The release workflow with gh action is fixed in c93edd4ff194032de52461aa1e8d3dcbe51cb98a