libusb shared object file paths

  • Open
  • quality assurance status badge
Details
2 participants
  • Garek Dyszel
  • Reed Meyerson
Owner
unassigned
Submitted by
Reed Meyerson
Severity
normal
R
R
Reed Meyerson wrote on 2 Jul 2023 01:08
(address . bug-guix@gnu.org)
CANv=NwEow7wjaZu5yySTBuB=p7CkiSvcdCwpHX1hNvUJp=b95A@mail.gmail.com
Hello,

I have been trying to get the teensy-loader-cli package working on my
machine and I am running into shared object file related errors.

explanation of bug:

running "teensy_loader_cli" (from the "teensy-loader-cli" package) gives
the following error:

teensy_loader_cli: error while loading libusb-1.0.so.0 from
libusb-0.1.so.4: libusb-1.0.so.0: cannot open shared object file: No such
file or directory

How to reproduce the bug:

$ guix shell --container teensy_loader_cli
[env]$ teensy_loader_cli

In the guix shell container, it does seem that there is no file for
libusb-1.0.so.0. In particular $GUIX_ENVIRONMENT/lib doesn't exist. I can
include the file in the environment by adding the libusb package:

$ guix shell --container teensy_loader_cli libusb coreutils
[env]$ ls $GUIX_ENVIRONMENT/lib
libusb-1.0.a libusb-1.0.so libusb-1.0.so.0.3.0
libusb-1.0.la libusb-1.0.so.0 pkgconfig

However,
[env]$ teensy_loader_cli
still gives the same error as before.

I can get it to run by manually setting the $LD_LIBRARY_PATH variable:

[env]$ LD_LIBRARY_PATH=$GUIX_ENVIRONMENT/lib teensy_loader_cli

Best,
Reed
Attachment: file
G
G
Garek Dyszel wrote on 18 Aug 2023 17:49
(address . 64409@debbugs.gnu.org)(name . Reed Meyerson)(address . reed.meyerson@gmail.com)
87ttsw73ku.fsf@disroot.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Reed,

At 19:08 2023-07-01 UTC-0400, Reed Meyerson <address@hidden> wrote:
Toggle quote (4 lines)
>I can get it to run by manually setting the $LD_LIBRARY_PATH variable:
>
>[env]$ LD_LIBRARY_PATH=$GUIX_ENVIRONMENT/lib teensy_loader_cli

It seems I found a solution to your problem based on your clue here.
It's kind of a hack since I'm sure the maintainers are trying to get rid
of this, but... the solution is to use libusb-0.1 as a replacement for
the libusb-compat input.

Here's a package variant that does exactly that.

teensy-loader-cli-unbroken.scm:
- --8<---------------cut here---------------start------------->8---
(define-module (teensy-loader-cli-unbroken)
#:use-module (guix packages)
#:use-module (guix build utils)
#:use-module (gnu packages libusb)
#:use-module (gnu packages flashing-tools))

(define-public teensy-loader-cli-unbroken
(package
(inherit teensy-loader-cli)
(name "teensy-loader-cli-unbroken")
(inputs (list libusb-0.1))))

teensy-loader-cli-unbroken

- --8<---------------cut here---------------end--------------->8---

It works on my system and gives the usual output.

- --8<---------------cut here---------------start------------->8---
$ $(guix build -f ./teensy-loader-cli-unbroken.scm)/bin/teensy_loader_cli
Filename must be specified

Usage: teensy_loader_cli --mcu=<MCU> [-h] [-w] [-n] [-b] [-v] <file.hex>
-h : Print this help message
-w : Wait for device to appear
-r : Use hard reboot if device not online
-s : Use soft reboot if device not online (Teensy 3.x & 4.x)
-n : No reboot after programming
-b : Boot only, do not program
-v : Verbose output

Use `teensy_loader_cli --list-mcus` to list supported MCUs.

For more information, please visit:
- --8<---------------cut here---------------end--------------->8---

Note that I didn't try to flash anything with it yet. I'm working on
getting the udev rule to install with teensy-loader-cli, but I most
likely won't have that done anytime soon (or at all, if I lose
interest!).

I've been fighting with this sporadically over the last year, and this
was what I needed to get it working. Thanks for the hint!

Garek
-----BEGIN PGP SIGNATURE-----

iQHMBAEBCAA2FiEEdeLnvfwHNTIxccGsHY28ysRsRfIFAmTfkygYHGdhcmVrZHlz
emVsQGRpc3Jvb3Qub3JnAAoJEB2NvMrEbEXyp7kL/0gJ1aVbjcpWWz2y6/G7eCAQ
zxn1itOz5mWJcoKiXdfsWiu7FiCxdaWOpH1tpBwZ9po2cdz8pvjARI+TCBTfIqAp
h0uhELABjy+pzUs2q5V3pBx8IXYroE3Jz7NKcOwiUdFxS9KE7fCQMBJXoXY19ZKi
O1P3eRQph4iv1K624aLjnl3i1iV8KXS6IYphoGzvy9oV57ns5Va4/DojzNIaCihq
msmp2kxkjcGJKGlpskQ9bs7Pe4R2EXHJT1kCvAcmSzJZvYYQcony1e9g580mgmVA
cZ3oQOWWmQy6OMjVseKuMOv3biFTisPZitXv0fmvwA44vBLH96BG/qg6naGNDnRX
cZGIWAGsui7Y90dUXj1iw6pzMQH1nlkimmpch+nCjci1whsm9Is2yqIITambnr1W
czHxqcmF/49mFxKAmr9+dpFiiy40mcHu64kqRT6PewaIuo5xfHkNI3OWEKZtAqRY
rxSnKS1/pxz5SGR7gprCS48Jt+zIZsXpZeDdEBxQvQ==
=xKJo
-----END PGP SIGNATURE-----
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 64409@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 64409
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch