balena-io-hardware / testbot-sdk-sw

Node SDK for controlling and performing operations with testbot
https://www.npmjs.com/package/@balena/testbot
Apache License 2.0
4 stars 0 forks source link

Consider adding installation instructions for libusb #14

Open vipulgupta2048 opened 3 years ago

vipulgupta2048 commented 3 years ago
➜  testbotsdk git:(master) ✗ npm install
Building uhubctl from https://github.com/mvp/uhubctl/archive/refs/tags/v2.4.0.tar.gz
Error: Command failed: /bin/sh -c make
fatal: not a git repository (or any of the parent directories): .git
Package libusb-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libusb-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libusb-1.0' found
Package libusb-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libusb-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libusb-1.0' found
uhubctl.c:35:10: fatal error: libusb-1.0/libusb.h: No such file or directory
   35 | #include <libusb-1.0/libusb.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:41: uhubctl] Error 1

cc  -g -O0 -Wall -Wextra -std=c99 -pedantic -DPROGRAM_VERSION=\"2.4.0\"  uhubctl.c -o uhubctl -Wl,-zrelro,-znow 
 - Ensure libusb-1.0 is installed.

Solved with --> sudo apt-get install libusb-1.0-0-dev

Bucknalla commented 3 years ago

@vipulgupta2048 were you building this on an x86 platform? We basically don't expect it to be built against x86 because you're never going to run against something that isn't a balenaFin and we package a pre-compiled binary for the uhubctl which shouldnt require libusb

vipulgupta2048 commented 3 years ago

Yes. We have to consider the possibility of folks building/developing testbotsdk on x86. I couldn't do an NPM install for adding a new package to the package.json because of the preinstall step of installing uhubctl

vipulgupta2048 commented 2 years ago

This is still an issue and comes up when installing Leviathan on x86 systems.

Bucknalla commented 2 years ago

@vipulgupta2048 I'll open a PR to address this