You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What gem should be added
LIBUSB is a Ruby binding that gives Ruby programmers access to arbitrary USB devices.
I'd like to add a PR for this gem, but ran into problems when bitbaking the recipe (see here) dive-gozo@6251273
The error message says
ERROR: failed to build gem native extension
extconf failed, exit code 1
in 'require': cannot load such file -- ffi (LoadError)
from extconf.rb:4:in '<main>'
libusb has build dependencies on rubygems-ffi-native and rubygems-mini-portile2-native.
The problem with rubygems-ffi-native is, that libusb's ext/extconf.rb requires 'ffi' in line 4, which is not in Ruby's $LOAD_PATH.
bitbake rubygems-ffi and bitbake rubygems-ffi-native are running successfully.
As a result ffi is available in poky/build/tmp/work/x86_64-linux/rubygems-libusb-native/0.7.1/recipe-sysroot-native/usr/lib/ruby/gems/3.3.0/gems/ffi-1.16.3/lib/ffi
Unfortunately, I didn't find a solution to tell Ruby where to find ffi, when compiling the extension for libusb.
See #309.
The problem is that the implementation does not provide the entire cross compiling toolchain.
It can for a single gem (incl. as many as possible cross compiled extensions) compile the target code, but
it cannot use the results to cross-link against those results in a gem extension that depends on that.
This would require a full cross-compiled ruby, which is still pretty annoying to patch in on every patch of the ruby runtime.
I haven't spend time on that, and likely won't any time soon, but I'm open to accept PRs (libusb being the perfect example).
Thank you Konrad, for your very fast response and the link to the older issue.
Unfortunately, I'm not a Ruby expert and can't provide the needed patches to make libusb cross-compile.
If you like, you can close this issue.
What gem should be added
LIBUSB is a Ruby binding that gives Ruby programmers access to arbitrary USB devices.
I'd like to add a PR for this gem, but ran into problems when bitbaking the recipe (see here)
dive-gozo@6251273
The error message says
libusb has build dependencies on rubygems-ffi-native and rubygems-mini-portile2-native.
The problem with rubygems-ffi-native is, that libusb's ext/extconf.rb requires 'ffi' in line 4, which is not in Ruby's $LOAD_PATH.
bitbake rubygems-ffi and bitbake rubygems-ffi-native are running successfully.
As a result ffi is available in poky/build/tmp/work/x86_64-linux/rubygems-libusb-native/0.7.1/recipe-sysroot-native/usr/lib/ruby/gems/3.3.0/gems/ffi-1.16.3/lib/ffi
Unfortunately, I didn't find a solution to tell Ruby where to find ffi, when compiling the extension for libusb.
Any help is very appreciated.
Link to gem on rubygems.org
https://rubygems.org/gems/libusb
The text was updated successfully, but these errors were encountered: