I've been making modifications to the way we distribute https://github.com/qmk/qmk_cli -- rather than providing a brew package, we use uv to create a distribution on the user's machine as part of the bootstrapping process, which installs qmk as a global tool -- and this has hid as a dependency. These are installed fine, with uv handling the dependency management within the python virtual environment.
Now, one of the other prerequisites on macOS is to install libhidapi using brew to allow its use by this library. This gets installed into /opt/homebrew/lib on my machine, much like what you found on #50.
Unfortunately we're seeing that we simply cannot import those libraries without setting $DYLD_LIBRARY_PATH on the shell -- something we really would like to avoid requiring users to do. Unfortunately the proposed fix in #50 to set DYLD_LIBRARY_PATH using os.environ doesn't seem to function on newer versions of either Python or macOS.
#66 does seem to address this problem, but it seems you're not a fan of using that solution in this library.
Requiring QMK users (who in general aren't the most tech-savvy) to run DYLD_LIBRARY_PATH=/opt/homebrew/lib qmk console on macOS instead of the current qmk console isn't too palatable on our end either.
What options do we have to move forward with any sort of solution, if any?
I've been making modifications to the way we distribute https://github.com/qmk/qmk_cli -- rather than providing a
brewpackage, we useuvto create a distribution on the user's machine as part of the bootstrapping process, which installsqmkas a global tool -- and this hashidas a dependency. These are installed fine, withuvhandling the dependency management within the python virtual environment.Now, one of the other prerequisites on macOS is to install
libhidapiusingbrewto allow its use by this library. This gets installed into/opt/homebrew/libon my machine, much like what you found on #50.Unfortunately we're seeing that we simply cannot import those libraries without setting
$DYLD_LIBRARY_PATHon the shell -- something we really would like to avoid requiring users to do. Unfortunately the proposed fix in #50 to set DYLD_LIBRARY_PATH using os.environ doesn't seem to function on newer versions of either Python or macOS.#66 does seem to address this problem, but it seems you're not a fan of using that solution in this library.
Requiring QMK users (who in general aren't the most tech-savvy) to run
DYLD_LIBRARY_PATH=/opt/homebrew/lib qmk consoleon macOS instead of the currentqmk consoleisn't too palatable on our end either.What options do we have to move forward with any sort of solution, if any?