TomWhitwell / SlowMovie

MIT License
342 stars 67 forks source link

IT8951 module fails to build on Bookworm (arm64) as part of the install #152

Closed JonCellini closed 10 months ago

JonCellini commented 10 months ago

On the Bookworm arm64 OS the IT8951 package fails to build and the install of SlowMovie will fail. This is a regression from Bullseye as the same code installs correctly as expected.

Steps to Reproduce Install a fresh copy of Bookworm. Run the SlowMovie installer and it will fail while compiling the IT8951 module.

` Running setup.py install for RPi.GPIO ... done DEPRECATION: IT8951 is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 Running setup.py install for IT8951 ... error error: subprocess-exited-with-error

× Running setup.py install for IT8951 did not run successfully. │ exit code: 1 ╰─> [54 lines of output] running install /home/pi/SlowMovie/.venv/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py creating build creating build/lib.linux-aarch64-cpython-311 creating build/lib.linux-aarch64-cpython-311/IT8951 copying IT8951/interface.py -> build/lib.linux-aarch64-cpython-311/IT8951 copying IT8951/constants.py -> build/lib.linux-aarch64-cpython-311/IT8951 copying IT8951/display.py -> build/lib.linux-aarch64-cpython-311/IT8951 copying IT8951/init.py -> build/lib.linux-aarch64-cpython-311/IT8951 running build_ext building 'IT8951.spi' extension creating build/temp.linux-aarch64-cpython-311 creating build/temp.linux-aarch64-cpython-311/IT8951 aarch64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/pi/SlowMovie/.venv/include -I/usr/include/python3.11 -c IT8951/spi.c -o build/temp.linux-aarch64-cpython-311/IT8951/spi.o IT8951/spi.c: In function ‘Pyx_TraceSetupAndCall’: IT8951/spi.c:22082:37: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’} 22082 | if (CYTHON_TRACE && (frame)->f_trace == NULL) { | ^~ IT8951/spi.c:22084:21: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’} 22084 | (frame)->f_trace = Py_None; | ^~ IT8951/spi.c:438:62: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’} 438 | #define Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) | ^~ IT8951/spi.c:22091:5: note: in expansion of macro ‘Pyx_PyFrame_SetLineNumber’ 22091 | Pyx_PyFrame_SetLineNumber(frame, firstlineno); | ^~~~~~~ IT8951/spi.c: In function ‘__Pyx_PyBytes_Equals’: IT8951/spi.c:23312:13: warning: ‘ob_shash’ is deprecated [-Wdeprecated-declarations] 23312 | hash1 = ((PyBytesObject)s1)->ob_shash; | ^~~~~ In file included from /usr/include/python3.11/bytesobject.h:62, from /usr/include/python3.11/Python.h:50, from IT8951/spi.c:6: /usr/include/python3.11/cpython/bytesobject.h:7:35: note: declared here 7 | Py_DEPRECATED(3.11) Py_hash_t ob_shash; | ^~~~ IT8951/spi.c:23313:13: warning: ‘ob_shash’ is deprecated [-Wdeprecated-declarations] 23313 | hash2 = ((PyBytesObject*)s2)->ob_shash; | ^~~~~ /usr/include/python3.11/cpython/bytesobject.h:7:35: note: declared here 7 | Py_DEPRECATED(3.11) Py_hash_t ob_shash; | ^~~~ IT8951/spi.c: In function ‘Pyx_AddTraceback’: IT8951/spi.c:438:62: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’} 438 | #define Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) | ^~ IT8951/spi.c:24384:5: note: in expansion of macro ‘Pyx_PyFrame_SetLineNumber’ 24384 | Pyx_PyFrame_SetLineNumber(py_frame, py_line); | ^~~~~~~ error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> IT8951

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.`

Platform Information Raspberry Pi 3A, Debian GNU/Linux 12 (bookworm), 6.1.0-rpi4-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.54-1+rpt2 (2023-10-05) aarch64 GNU/Linux, Python 3.11.2

JonCellini commented 10 months ago

This is corrected in my latest PR commit. I tested it successfully on my local PI running a fresh install of Bookworm.

kagane01 commented 10 months ago

Hi, I'm still running into this error. Very unfamiliar territory for me here, so pardon any missed knowledge. What do I do to fix this? All help is appreciated. Please see below for error code:

` % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6035 100 6035 0 0 26421 0 --:--:-- --:--:-- --:--:-- 26585 Hit:1 http://deb.debian.org/debian bookworm InRelease Get:2 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB] Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
Hit:4 http://archive.raspberrypi.com/debian bookworm InRelease Fetched 48.0 kB in 1s (32.5 kB/s)
Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done ffmpeg is already the newest version (8:5.1.3-1+rpt4). git is already the newest version (1:2.39.2-1.1). python3-pip is already the newest version (23.0.1+dfsg-1+rpt1). libatlas-base-dev is already the newest version (3.10.3-13). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Setting up SPI SPI already enabled Existing Install Found - Updating Repo Already on 'main' Your branch is up to date with 'origin/main'. Already up to date. Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting waveshare-epd Cloning https://github.com/waveshare/e-Paper.git to /tmp/pip-install-i3_gacfa/waveshare-epd_907cb4d49e114cbab771d8464309423f Running command git clone --filter=blob:none --quiet https://github.com/waveshare/e-Paper.git /tmp/pip-install-i3_gacfa/waveshare-epd_907cb4d49e114cbab771d8464309423f Resolved https://github.com/waveshare/e-Paper.git to commit 4822c075f5df714f88b02e10c336b4eeff7e603e Preparing metadata (setup.py) ... done Collecting omni-epd Cloning https://github.com/robweber/omni-epd.git (to revision v0.3.4) to /tmp/pip-install-i3_gacfa/omni-epd_7114db8844de48458036983ba254e9ee Running command git clone --filter=blob:none --quiet https://github.com/robweber/omni-epd.git /tmp/pip-install-i3_gacfa/omni-epd_7114db8844de48458036983ba254e9ee Resolved https://github.com/robweber/omni-epd.git to commit af4414d8d08b23f23ad49ae0a144d5e55dd5ab56 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting ffmpeg-python==0.2.0 Using cached https://www.piwheels.org/simple/ffmpeg-python/ffmpeg_python-0.2.0-py3-none-any.whl (25 kB) Requirement already satisfied: Pillow>=9.1.0 in ./env/lib/python3.11/site-packages (from -r /home/ekagan/SlowMovie/Install/requirements.txt (line 2)) (10.1.0) Collecting ConfigArgParse==1.4.1 Using cached https://www.piwheels.org/simple/configargparse/ConfigArgParse-1.4.1-py3-none-any.whl (19 kB) Collecting future Using cached https://www.piwheels.org/simple/future/future-0.18.3-py3-none-any.whl (492 kB) Requirement already satisfied: Jetson.GPIO in ./env/lib/python3.11/site-packages (from waveshare-epd->-r /home/ekagan/SlowMovie/Install/requirements.txt (line 4)) (2.1.4) Collecting IT8951@ git+https://github.com/GregDMeyer/IT8951 Cloning https://github.com/GregDMeyer/IT8951 to /tmp/pip-install-i3_gacfa/it8951_d36749f97f2e4a5b9a038d57af04c497 Running command git clone --filter=blob:none --quiet https://github.com/GregDMeyer/IT8951 /tmp/pip-install-i3_gacfa/it8951_d36749f97f2e4a5b9a038d57af04c497 Resolved https://github.com/GregDMeyer/IT8951 to commit 67215164a7fc471bc6904f72ad55e51030905a97 Preparing metadata (setup.py) ... done Collecting inky[rpi]>=1.3.1 Using cached https://www.piwheels.org/simple/inky/inky-1.5.0-py3-none-any.whl (32 kB) Collecting numpy Using cached numpy-1.26.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.2 MB) Requirement already satisfied: smbus2 in ./env/lib/python3.11/site-packages (from inky[rpi]>=1.3.1->omni-epd->-r /home/ekagan/SlowMovie/Install/requirements.txt (line 5)) (0.4.3) Requirement already satisfied: spidev in ./env/lib/python3.11/site-packages (from inky[rpi]>=1.3.1->omni-epd->-r /home/ekagan/SlowMovie/Install/requirements.txt (line 5)) (3.6) Requirement already satisfied: RPi.GPIO in ./env/lib/python3.11/site-packages (from inky[rpi]>=1.3.1->omni-epd->-r /home/ekagan/SlowMovie/Install/requirements.txt (line 5)) (0.7.1) Building wheels for collected packages: omni-epd Building wheel for omni-epd (pyproject.toml) ... done Created wheel for omni-epd: filename=omni_epd-0.3.4-py3-none-any.whl size=1516058 sha256=9234c1b4aeb7591bb08d25dd969a982755125b0299bdd7d4941f0951223b1ca2 Stored in directory: /tmp/pip-ephem-wheel-cache-xa358l65/wheels/d8/2a/19/c55e015a675c2c068f63f29cc9e8f32c28ed6db7ace31dd937 Successfully built omni-epd Installing collected packages: IT8951, numpy, future, ConfigArgParse, inky, ffmpeg-python, omni-epd DEPRECATION: IT8951 is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 Running setup.py install for IT8951 ... error error: subprocess-exited-with-error

Running setup.py install for IT8951 did not run successfully. exit code: 1

[54 lines of output] running install /home/ekagan/env/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py creating build creating build/lib.linux-aarch64-cpython-311 creating build/lib.linux-aarch64-cpython-311/IT8951 copying IT8951/interface.py -> build/lib.linux-aarch64-cpython-311/IT8951 copying IT8951/init.py -> build/lib.linux-aarch64-cpython-311/IT8951 copying IT8951/constants.py -> build/lib.linux-aarch64-cpython-311/IT8951 copying IT8951/display.py -> build/lib.linux-aarch64-cpython-311/IT8951 running build_ext building 'IT8951.spi' extension creating build/temp.linux-aarch64-cpython-311 creating build/temp.linux-aarch64-cpython-311/IT8951 aarch64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/ekagan/env/include -I/usr/include/python3.11 -c IT8951/spi.c -o build/temp.linux-aarch64-cpython-311/IT8951/spi.o IT8951/spi.c: In function 'Pyx_TraceSetupAndCall': IT8951/spi.c:22082:37: error: invalid use of incomplete typedef 'PyFrameObject' {aka 'struct _frame'} 22082 | if (CYTHON_TRACE && (frame)->f_trace == NULL) { | ^~ IT8951/spi.c:22084:21: error: invalid use of incomplete typedef 'PyFrameObject' {aka 'struct _frame'} 22084 | (frame)->f_trace = Py_None; | ^~ IT8951/spi.c:438:62: error: invalid use of incomplete typedef 'PyFrameObject' {aka 'struct _frame'} 438 | #define Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) | ^~ IT8951/spi.c:22091:5: note: in expansion of macro 'Pyx_PyFrame_SetLineNumber' 22091 | Pyx_PyFrame_SetLineNumber(frame, firstlineno); | ^~~~~~~ IT8951/spi.c: In function '__Pyx_PyBytes_Equals': IT8951/spi.c:23312:13: warning: 'ob_shash' is deprecated [-Wdeprecated-declarations] 23312 | hash1 = ((PyBytesObject)s1)->ob_shash; | ^~~~~ In file included from /usr/include/python3.11/bytesobject.h:62, from /usr/include/python3.11/Python.h:50, from IT8951/spi.c:6: /usr/include/python3.11/cpython/bytesobject.h:7:35: note: declared here 7 | Py_DEPRECATED(3.11) Py_hash_t ob_shash; | ^~~~ IT8951/spi.c:23313:13: warning: 'ob_shash' is deprecated [-Wdeprecated-declarations] 23313 | hash2 = ((PyBytesObject*)s2)->ob_shash; | ^~~~~ /usr/include/python3.11/cpython/bytesobject.h:7:35: note: declared here 7 | Py_DEPRECATED(3.11) Py_hash_t ob_shash; | ^~~~ IT8951/spi.c: In function 'Pyx_AddTraceback': IT8951/spi.c:438:62: error: invalid use of incomplete typedef 'PyFrameObject' {aka 'struct _frame'} 438 | #define Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) | ^~ IT8951/spi.c:24384:5: note: in expansion of macro 'Pyx_PyFrame_SetLineNumber' 24384 | Pyx_PyFrame_SetLineNumber(py_frame, py_line); | ^~~~~~~ error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

Encountered error while trying to install package.

IT8951

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure. SlowMovie service is installed, checking if it needs an update No update needed`

JonCellini commented 10 months ago

I corrected this in my fork of the project, it will compile the IT8951 module correctly on Bookworm. Unfortunately, the waveshare_epd doesn't currently work due the deprecation of the sysfs interface that package is using. More detail on that is explained here.

For now your best bet is to revert back to Bullseye as it still has support for the sysfs the waveshare_epd package is looking for.

robweber commented 10 months ago

Working on getting Bookworm up and running to test everything and iron out the waveshare issues. Don't want to mess with my "live" system so pulling out spare parts for a test environment.

JonCellini commented 10 months ago

Cool. I've got a few extra pi's kicking around so happy to help test if you need it.

robweber commented 10 months ago

going to close this since issues around the IT8951 hardware have been resolved in the upstream repo.