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

Set DYLD_FALLBACK_LIBRARY_PATH on macOS #41

Closed

Conversation

cdwilson
Copy link

@cdwilson cdwilson commented Jul 14, 2024

Potential fix for greatscottgadgets/cynthion#136

Homebrew patches it's own python so that ctypes.find_library can find libraries also installed by homebrew. When using a version of python not installed by Homebrew, this sets DYLD_FALLBACK_LIBRARY_PATH so that the homebrew-installed libusb library is found.

I tested this on my ARM Mac, but I don't have an Intel Mac to test this with. Can somebody with an Intel Mac try this out and see if it also works for them?

Homebrew patches it's own python so that ctypes.find_library can find
libraries also installed by homebrew. When using a version of python
not installed by Homebrew, this sets DYLD_FALLBACK_LIBRARY_PATH so that
the homebrew-installed libraries are found.
@depili
Copy link

depili commented Jul 14, 2024

Should this also check the existence of the the homebrew environment variable?

@martinling
Copy link
Member

I feel like it might be better to warn the user if the libusb dylib isn't found, and give them advice on fixing that, rather than just tweaking the search path internally in libgreat (or in any of our other Python projects).

Otherwise you get a quite confusing situation where scripts using our libraries will work, but other software, or users' own scripts using pyusb or libusb1 directly, will not work.

@cdwilson
Copy link
Author

@martinling that makes sense, I'll close this out in favor of what you are suggesting.

@cdwilson cdwilson closed this Jul 14, 2024
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

Successfully merging this pull request may close these issues.

3 participants