home-assistant/addons-development

Using Hassio Addons Development to install raspberry sensehat

denics opened this issue · 3 comments

Dear all,
thanks for this module, very interesting. I run into it while searching how to enable Sense HAT on a HassOs on Raspberry Pi.
If I SSH in my instance I can compile correctly. However, for some reasons, when I use the add-on I do not have the same result.

Here are the steps I am doing with SSH:

apk add python-dev raspberrypi-dev raspberrypi-libs gcc g++
git clone https://github.com/RPi-Distro/RTIMULib
cd ./RTIMULib/Linux/python/
python3 setup.py build

and it compiles successfully.

Unfortunately I do not have the same result using the add-on and this configuration:

pypi:
  - rtimulib==7.2.1
apk:
  - py3-sensehat
  - gcc
  - g++
  - i2c-tools-dev
  - python3-dev
  - raspberrypi-dev
  - raspberrypi-libs

This is the output:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[Info] Remove old deps
[Info] Install apks for build
[Info] Install pypi modules into deps
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6ywne6jx/rtimulib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6ywne6jx/rtimulib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-0tsi2y72
       cwd: /tmp/pip-install-6ywne6jx/rtimulib/
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'RTIMU' extension
  creating build
  creating build/temp.linux-armv7l-3.8
  creating RTIMULib
  creating RTIMULib/IMUDrivers
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -ljemalloc -DTHREAD_STACK_SIZE=0x100000 -fPIC -DHAL_QUIET -I../../RTIMULib -I/usr/local/include/python3.8 -c PyRTIMU.cpp -o build/temp.linux-armv7l-3.8/PyRTIMU.o -std=c++0x
  PyRTIMU.cpp:28:10: fatal error: PyRTIMU.h: No such file or directory
     28 | #include "PyRTIMU.h"
        |          ^~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for rtimulib
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6ywne6jx/rtimulib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6ywne6jx/rtimulib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-4u0qbxie/install-record.txt --single-version-externally-managed --prefix '' --user --prefix= --compile --install-headers /config/deps/include/python3.8/rtimulib
         cwd: /tmp/pip-install-6ywne6jx/rtimulib/
    Complete output (12 lines):
    running install
    running build
    running build_ext
    building 'RTIMU' extension
    creating build
    creating build/temp.linux-armv7l-3.8
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -ljemalloc -DTHREAD_STACK_SIZE=0x100000 -fPIC -DHAL_QUIET -I../../RTIMULib -I/usr/local/include/python3.8 -c PyRTIMU.cpp -o build/temp.linux-armv7l-3.8/PyRTIMU.o -std=c++0x
    PyRTIMU.cpp:28:10: fatal error: PyRTIMU.h: No such file or directory
       28 | #include "PyRTIMU.h"
          |          ^~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6ywne6jx/rtimulib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6ywne6jx/rtimulib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-4u0qbxie/install-record.txt --single-version-externally-managed --prefix '' --user --prefix= --compile --install-headers /config/deps/include/python3.8/rtimulib Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 20.2.4 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
[Error] Can't install PyPI packages!
Collecting rtimulib==7.2.1
  Downloading RTIMULib-7.2.1.tar.gz (7.2 kB)
Building wheels for collected packages: rtimulib
  Building wheel for rtimulib (setup.py): started
  Building wheel for rtimulib (setup.py): finished with status 'error'
  Running setup.py clean for rtimulib
Failed to build rtimulib
Installing collected packages: rtimulib
    Running setup.py install for rtimulib: started
    Running setup.py install for rtimulib: finished with status 'error'
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Thanks a lot for your help and your time.

I forgot to mention that is linked to #32692 and #24866 closed by the bot killer but never solved.

Dear all, I know I am talking alone but here is the solution I came with:

pypi:
  - >-
    git+https://github.com/RPi-Distro/RTIMULib#egg=rtimulib&subdirectory=Linux/python
apk:
  - gcc
  - g++
  - py3-sensehat
  - i2c-tools-dev
  - python3-dev
  - raspberrypi-dev
  - raspberrypi-libs

and it is working! I am going to change the title of the issue as it does not reflect the issue of the problem. The steps to make this work are documented in this PR

wi

Dear all, I know I am talking alone but here is the solution I came with:

pypi:
  - >-
    git+https://github.com/RPi-Distro/RTIMULib#egg=rtimulib&subdirectory=Linux/python
apk:
  - gcc
  - g++
  - py3-sensehat
  - i2c-tools-dev
  - python3-dev
  - raspberrypi-dev
  - raspberrypi-libs

and it is working! I am going to change the title of the issue as it does not reflect the issue of the problem. The steps to make this work are documented in this PR

with this code i get an error:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[Info] Remove old deps
[Info] Install apks for build
[Info] Install pypi modules into deps
Running command git clone -q https://github.com/RPi-Distro/RTIMULib /tmp/pip-install-o_qx4viu/rtimulib
WARNING: You are using pip version 20.1.1; however, version 20.3.3 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
[Info] done
[cmd] /run.sh exited 0
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Is the pip version part of the hassio virtual environment?