conda-forge / libusb-feedstock

A conda-smithy repository for libusb.
BSD 3-Clause "New" or "Revised" License
0 stars 6 forks source link

Broken patch for libudev? #14

Closed bibbygoodwin closed 3 years ago

bibbygoodwin commented 3 years ago

Hi, I must admit I'm not good enough to entirely parse what's going on at: https://github.com/conda-forge/libusb-feedstock/blob/master/recipe/post-link.sh

...but I feel like some problems I am running into with a Ros package using your libusb from conda might stem from something happening there. When checking library dependencies I get a: libudev.so.0 => not found

What is the intention of the patch? I can provide more context if needed!

Many thanks!

ryanvolz commented 3 years ago

You need libudev.so.0 installed on your system, separate from conda, and it looks like that's missing. Try installing it through your package manager.

The purpose of that script is that most modern Linux systems have libudev.so.1 instead, so it makes a link to use that in place of libudev.so.0. That doesn't seem related to your problem, but it might be. What architecture and distribution are you running?

bibbygoodwin commented 3 years ago

Thanks @ryanvolz for the swift reply! I'm on Ubuntu 18.04, and I have libudev.so.1 installed at /lib/x86_64-linux-gnu/libudev.so.1. When running something from a Robostack package (for a realsense camera) I get an error:

Error string: Could not load library (Poco exception = libudev.so.0: cannot open shared object file: No such file or directory)

I'm assuming that I was right to trace this to libusb, which is where I believe this dependency comes in. conda list | grep usb gives:

libusb                    1.0.24               h18f079d_4    conda-forge

Thanks for your help!

ryanvolz commented 3 years ago

Then to solve your problem, it should be sufficient to make a link to libudev.so.1 under the name libudev.so.0 inside your conda prefix:

ln -s "/lib/x86_64-linux-gnu/libudev.so.1" "$CONDA_PREFIX/lib/libudev.so.0"

I'm more interested in why the post-link script didn't accomplish that, so if you're willing it would be helpful (before implementing the above fix) to run the lines in $CONDA_PREFIX/bin/.libusb-post-link.sh one by one and see where it goes wrong in making that link.

I'm looking forward to when conda-forge moves to a CentOS 7 base and we shouldn't need this hacky workaround anymore.