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

search for local libdiscid #9

Merged
merged 1 commit into from
Apr 29, 2013
Merged

search for local libdiscid #9

merged 1 commit into from
Apr 29, 2013

Conversation

JonnyJD
Copy link
Contributor

@JonnyJD JonnyJD commented Apr 29, 2013

This will additionally search for libdiscid in the current folder.
Darwin needs this since the official standalone name is not libdiscid.dylib
and Linux because it won't search in the current folder if not
explicitely asked.
Windows should be fine as is.

Not sure if you want that functionality, but for things like isrcsubmit I depend on finding local libdiscid to distribute packages with included libdiscid.
More important on Windows and Mac than with Linux. Since Linux includes libdiscid in most repositories anyways.

This is an optional addition to #6

This will additionally search for libdiscid in the current folder.
Darwin needs this since the official standalone name is not `libdiscid.dylib`
and Linux because it won't search in the current folder if not
explicitely asked.
Windows should be fine as is.
@JonnyJD JonnyJD mentioned this pull request Apr 29, 2013
@phw
Copy link
Owner

phw commented Apr 29, 2013

That means on Darwin it will search in the current folder, but needs to look for libdiscid.0.dylib as it otherwise would only look for libdiscid.dylib (similar as we need libdiscid.so.0), right?

@JonnyJD
Copy link
Contributor Author

JonnyJD commented Apr 29, 2013

Yes.

For the details on what OSs do with local libraries see JonnyJD/python-discid#14. (The underlying problems are system calls, so there is not much of a difference to Python).
One difference in how it works now is, that ruby-discid doesn't force prefer using the local libdiscid on Linux.

If you wish to prefer local libdiscid then the ./ needs to move to the start of the array.

phw added a commit that referenced this pull request Apr 29, 2013
search for local libdiscid
@phw phw merged commit 87dec2e into phw:master Apr 29, 2013
@JonnyJD JonnyJD deleted the local_lib branch April 29, 2013 10:03
@phw
Copy link
Owner

phw commented Apr 29, 2013

Just wanted to inform you that I have removed the loading from the current directory on Linux again.

I did not feel comfortable with that option. Since that is very uncommon behavior on Linux and might cause hard to debug errors (different libdiscid.so loaded depending on the current working directory) I decided not to include this, at least not in the 1.0 release.

It's fine to support it on systems where this is common, but in general using the current working directory to load anything is IMHO a bad idea. There are reasons Unix systems normally don't do that. And after all we have just experienced some of the side effects of such configuration with Ruby 1.8 (sample discid.rb loading itself or discid.dll instead of the module).

I will probably consider making this optional so the user of ruby-discid can activate it. But that's something to think about in a future version :)

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.

2 participants