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

macOS: Prefer libdiscid.dylib in current folder #49

Open
phw opened this issue Nov 5, 2019 · 2 comments
Open

macOS: Prefer libdiscid.dylib in current folder #49

phw opened this issue Nov 5, 2019 · 2 comments

Comments

@phw
Copy link

phw commented Nov 5, 2019

On macOS when loading libdiscid and libdiscid.dylib is both available system wide (e.g. in /usr/local/) and local to the application, the system wide install is preferred.

However, especially when running from a bundled app it might be preferable to use the bundled version to be sure to get exactly the expected version.

Having the local version being preferred seems to have been the intention of #16, however it does not currently work this way.

Picard is affected by this, see https://tickets.metabrainz.org/browse/PICARD-1653

@phw
Copy link
Author

phw commented Nov 5, 2019

Probably it is not always preferable to use a local version. Also the location might be very special.

I checked for a macOS app created with PyInstaller: os.getcwd() in this case is always /. What I really would like to check for Picard is the directory where sys.executable is located, if the app is bundled (sys.frozen == True).

Maybe it's not ideal to make any hardcoded assumptions of the library location, but instead provide some mechanism to specify the library location.

@phw
Copy link
Author

phw commented Nov 5, 2019

So for Picard I decided to set the DYLD_FALLBACK_LIBRARY_PATH environment variable so libraries are searched in os.path.dirname(sys.executable). At least this fixes the issue in the code where we actually now where to look. See metabrainz/picard#1346

Not quite sure if this can / should be generically fixed in python-discid. I leave this issue open for comments.

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

No branches or pull requests

1 participant