home-assistant/wheels-custom-integrations

building wheel hidapi

Closed this issue · 5 comments

I'm writing a custom component that uses hidapi but getting following error.

I tried to install the gcc apk install gcc but the result is same (tested on rpi3, and x86_64)

Can i make a PR for requirements.txt to add hidapi?

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [26 lines of output]
/usr/local/lib/python3.11/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
running bdist_wheel
running build
running build_ext
cythoning hid.pyx to hid.c
/usr/local/lib/python3.11/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-ox_pleup/hidapi_d6500b4f92b84d669302d8baf04a986e/hid.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
cythoning hidraw.pyx to hidraw.c
/usr/local/lib/python3.11/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-ox_pleup/hidapi_d6500b4f92b84d669302d8baf04a986e/hidraw.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'hid' extension
creating build
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/hidapi
creating build/temp.linux-x86_64-cpython-311/hidapi/libusb
gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/local/include/python3.11 -c hid.c -o build/temp.linux-x86_64-cpython-311/hid.o
error: command 'gcc' failed: No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for hidapi
ERROR: Could not build wheels for hidapi, which is required to install pyproject.toml-based projects

running under "dockerized" it can be fixed via

apk add g++ linux-headers libusb-dev eudev-dev

but under HA os this didn't help

This repository could provide help with building those wheels, however, it is better to adjust the upstream project to provide musl compatible/based wheels instead; that way, any project using this benefits from that change.

Ok, if the maintainer don't want to do that, is it possible to build musl wheels for my project instead which could have hidapi somehow built in? i don't really know how those things work, i have javascript background. Here is my lib and integration Many thanks

If upstream refuses, we can try building wheels in this repo, which will be available on our wheels server (and used by Home Assistant instances).

Thanks a lot for the discussions, the upstream managed to upload muslwheel and it works beautifully now