python-soundfile icon indicating copy to clipboard operation
python-soundfile copied to clipboard

Try explicit file name, and look system-wide for library

Open shithead opened this issue 3 years ago • 11 comments
trafficstars

Try explicit file name, if the general does not work (e.g. on nixos) and if no local installed library sndfile, try system-wide

maybe additonal fix for #238, #258, #313,

shithead avatar Nov 27 '21 10:11 shithead

Looks good to me. Is this ready to merge from your end?

bastibe avatar Dec 01 '21 12:12 bastibe

GO, for it! :+1:

shithead avatar Dec 04 '21 09:12 shithead

Sorry, @shithead, but another pull request recently changed the import behavior for M1 Macs, which broke your pull request.

I can amend your pull request for you if you'd like, but then it's my name in the commit history, not yours. If you'd like the attribution, you'll have to rebase your pull request onto the latest state.

Sorry for the inconvenience.

bastibe avatar Dec 07 '21 08:12 bastibe

I try to solve it.

shithead avatar Dec 08 '21 12:12 shithead

@panosl can look that this PR is possible solve your problem like in #311, too?

shithead avatar Dec 08 '21 12:12 shithead

dlopen don't need an explicit path if LD_LIBRARY_PATH is right set. There is another solution possible with less complex code

import os as _os
_os.environ['LD_LIBRARY_PATH'] = ":".join([_os.path.join(_path,'_soundfile_data'),"/opt/homebrew/lib","/usr/local/lib",os.environ['LD_LIBRARY_PATH']])

set missing pathes to LD_LIBRARY_PATH environment.

shithead avatar Dec 08 '21 13:12 shithead

If I remember correctly, LD_LIBRARY_PATH is meant to be customized by the user, not the application. For example, I could imagine a user setting a custom LD_LIBRARY_PATH to force an application to use a debugging library instead of a built-in one. So at the very least, we should append to the end of LD_LIBRARY_PATH in order to not break things, but it's probably prudent to leave it alone altogether.

Do you know of any resource on how to use LD_LIBRARY_PATH correctly, and whether it is permissible for us to modify it in the app?

You just added a commit that seems like it should solve the merge conflict, but it is still listed as conflicting on Github.

bastibe avatar Dec 10 '21 08:12 bastibe

Sry, I am not familiar with Resolving confilicts by webui. I thinks, it's ready now.

shithead avatar Dec 11 '21 08:12 shithead

This seems to change the original logic flow I think. Why did you code it this way?

bastibe avatar Dec 22 '21 20:12 bastibe

https://github.com/bastibe/python-soundfile/pull/322#discussion_r778072645

Path specification is OS and programm specification not Machinearchitecture like arm64 or amd64. That's why I remove the machinearchitecture test.

Happy Eastern :egg: .

shithead avatar Apr 16 '22 05:04 shithead

dlopen don't need an explicit path if LD_LIBRARY_PATH is right set. There is another solution possible with less complex code

import os as _os
_os.environ['LD_LIBRARY_PATH'] = ":".join([_os.path.join(_path,'_soundfile_data'),"/opt/homebrew/lib","/usr/local/lib",os.environ['LD_LIBRARY_PATH']])

set missing pathes to LD_LIBRARY_PATH environment.

My solution required _os.environ['DYLD_LIBRARY_PATH'].

davidbernat avatar May 27 '22 14:05 davidbernat