Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pre-test RasPiOS 12 [cffi, cryptography, lxml "wheels" for Python 3.11 now exist!] #3526

Closed
jvonau opened this issue Apr 4, 2023 · 45 comments

Comments

@jvonau
Copy link
Contributor

jvonau commented Apr 4, 2023

Install the latest arm64 image of RasPiOS and boot

sudo apt update
sudo apt -y upgrade
sudo apt -y autoremove
sudo reboot 
sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list

sudo apt update
sudo apt -y dist-upgrade
# Don't go too far away there a couple of confirmations to confirm just press enter when prompted.
# Any changed files should be a result of the image creation process I would presume. 
# I hate suggesting that method but you can stop and read the actions and decide for yourself.

sudo apt -y autoremove
sudo reboot

sudo raspi-config and set the country code for the WiFi and other settings.
Might want to try the NetworkManager option at this time.
Edit: Make the required changes in local_facts.fact and provide a OS.yml file is covered with #3525 not needed now.
Install IIAB as per normal.

@jvonau
Copy link
Contributor Author

jvonau commented Apr 4, 2023

Just a how to note, not for general consumption but I thought I would share.

@jvonau jvonau closed this as completed Apr 4, 2023
@holta holta added this to the 8.1 milestone Apr 4, 2023
@holta
Copy link
Member

holta commented Apr 4, 2023

Install IIAB as per normal.

Did an IIAB install largely complete?

(Either way, instructions like this are indeed extremely useful for newcomers.)

Related:

@holta holta pinned this issue Apr 4, 2023
@jvonau
Copy link
Contributor Author

jvonau commented Apr 4, 2023

I went with the 'none' version of local_vars as a starting point, installed clean.

@jvonau
Copy link
Contributor Author

jvonau commented Apr 5, 2023

FYI

jerryv@box:~ $ apt list python2*
Listing... Done

@jvonau
Copy link
Contributor Author

jvonau commented Apr 5, 2023

#3289 (comment)

perhaps using the last deb package(s) released from an older install.

http://ftp.debian.org/debian/pool/main/p/python2.7/?C=M;O=D

wget http://ftp.debian.org/debian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8_arm64.deb
sudo apt install ./libpython2.7-minimal_2.7.18-8_arm64.deb
wget http://ftp.debian.org/debian/pool/main/p/python2.7/python2.7-minimal_2.7.18-8_arm64.deb
sudo apt install ./python2.7-minimal_2.7.18-8_arm64.deb

The order is important and are 'dpkg_arch' dependent, that was the reasoning behind my original #3518 having dpkg_arch available for other roles.

@holta
Copy link
Member

holta commented Apr 11, 2023

@jvonau mentions at #3535 (comment) :

http://raspbian.raspberrypi.org/ has a new file snapshotindex.txt suggesting there will be a new bookworm release sooner or later when you look at the bottom of the file

@holta holta reopened this Apr 11, 2023
@jvonau
Copy link
Contributor Author

jvonau commented Apr 11, 2023

I don't have time to try this but should work:
Install the latest armhf image of RasPiOS and boot

sudo apt update
sudo apt -y upgrade
sudo apt -y autoremove

apt info libpython2.7-stdlib > ~/libpython.txt 
# attach or pastebin the file to PR #3535 please.

sudo reboot 

sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list

sudo apt update
sudo apt -y dist-upgrade
# Don't go too far away there a couple of confirmations to confirm just press enter when prompted.
# Any changed files should be a result of the image creation process I would presume. 
# I hate suggesting that method but you can stop and read the actions and decide for yourself.

sudo apt -y autoremove
sudo reboot

Might not all be in place yet but post how far you get to.

@holta
Copy link
Member

holta commented Apr 11, 2023

@EMG70 would you have time in the coming week, to try the instructions immediately above?

@EMG70
Copy link
Contributor

EMG70 commented Apr 11, 2023

That’s OK, I will try it this week and let you know.

@jvonau
Copy link
Contributor Author

jvonau commented Apr 11, 2023

Stepping through an upgrade of an older install

jerryv@box:~ $ sudo apt update
Hit:1 http://ppa.launchpad.net/learningequality/kolibri/ubuntu focal InRelease
Hit:2 https://deb.nodesource.com/node_18.x bullseye InRelease                                          
Hit:3 http://archive.raspberrypi.org/debian bullseye InRelease                                         
Get:4 http://raspbian.raspberrypi.org/raspbian bookworm InRelease [15.0 kB]
Get:5 http://raspbian.raspberrypi.org/raspbian bookworm/main armhf Packages [14.5 MB]
Get:6 http://raspbian.raspberrypi.org/raspbian bookworm/contrib armhf Packages [62.3 kB]
Get:7 http://raspbian.raspberrypi.org/raspbian bookworm/non-free armhf Packages [118 kB]
Get:8 http://raspbian.raspberrypi.org/raspbian bookworm/rpi armhf Packages [1,360 B]
Fetched 14.7 MB in 9s (1,689 kB/s)                                                                                                      
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
795 packages can be upgraded. Run 'apt list --upgradable' to see them.

That was with iiab already install should be a smaller set on a newly written image

@jvonau
Copy link
Contributor Author

jvonau commented Apr 11, 2023

sudo apt -y dist-upgrade
The following packages will be REMOVED:
  fuse hardlink libnfsidmap2 libnginx-mod-http-lua libsemanage1 libsepol1-dev mariadb-client-10.5 mariadb-client-core-10.5
  mariadb-server-10.5 mariadb-server-core-10.5 nginx-extras php-pear php7.4-bcmath php7.4-cgi php7.4-cli php7.4-common php7.4-curl
  php7.4-fpm php7.4-gd php7.4-imap php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-snmp php7.4-xml
  php7.4-zip python-pip-whl python3-kms++ python3-libcamera python3-picamera2 python3-pidng python3-simplejpeg python3-spidev
  python3.9-venv
Get:917
Fetched 483 MB in 6min 25s (1,254 kB/s)  

most of these will not be installed on a fresh image.

@jvonau
Copy link
Contributor Author

jvonau commented Apr 11, 2023

This test box never had kalite installed so no python2 was ever installed http://sprunge.us/M2I5sQ

jerryv@box:~ $ apt list *python2*
Listing... Done
idle-python2.7/testing 2.7.18-13.2 all
libpython2-dbg/testing 2.7.18-3 armhf
libpython2-dev/testing 2.7.18-3 armhf
libpython2-stdlib/testing 2.7.18-3 armhf
libpython2.7-dbg/testing 2.7.18-13.2 armhf
libpython2.7-dev/testing 2.7.18-13.2 armhf
libpython2.7-minimal/testing 2.7.18-13.2 armhf
libpython2.7-stdlib/testing 2.7.18-13.2 armhf
libpython2.7-testsuite/testing 2.7.18-13.2 all
libpython2.7/testing 2.7.18-13.2 armhf
python2-dbg/testing 2.7.18-3 armhf
python2-dev/testing 2.7.18-3 armhf
python2-doc/testing 2.7.18-3 all
python2-minimal/testing 2.7.18-3 armhf
python2-setuptools-whl/testing 44.1.1-1.2 all
python2.7-dbg/testing 2.7.18-13.2 armhf
python2.7-dev/testing 2.7.18-13.2 armhf
python2.7-doc/testing 2.7.18-13.2 all
python2.7-examples/testing 2.7.18-13.2 all
python2.7-minimal/testing 2.7.18-13.2 armhf
python2.7/testing 2.7.18-13.2 armhf
python2/testing 2.7.18-3 armhf

Looks like they are going to ship python2

@jvonau
Copy link
Contributor Author

jvonau commented Apr 11, 2023

Bingo libssl3 is being used

jerryv@box:~ $ apt info libpython2.7-stdlib
Package: libpython2.7-stdlib
Version: 2.7.18-13.2
Priority: optional
Section: python
Source: python2.7
Maintainer: Matthias Klose <doko@debian.org>
Installed-Size: 10.0 MB
Provides: python-argparse, python2.7-argparse, python2.7-celementtree, python2.7-cjkcodecs, python2.7-ctypes, python2.7-elementtree, python2.7-profiler, python2.7-wsgiref
Depends: libpython2.7-minimal (= 2.7.18-13.2), libssl3 (>= 3.0.0), media-types | mime-support, libbz2-1.0, libc6 (>= 2.33), libcrypt1 (>= 1:4.1.0), libdb5.3, libexpat1 (>= 2.1~beta3), libffi8 (>= 3.4), libncursesw6 (>= 6), libnsl2 (>= 1.0), libreadline8 (>= 7.0~beta), libsqlite3-0 (>= 3.5.9), libtinfo6 (>= 6), libtirpc3 (>= 1.0.2)
Breaks: libgcj-common (<< 1:7), libpython-dbg (<< 2.7.18), libpython-dev (<< 2.7.18), libpython-stdlib (<< 2.7.18), libvolk1-bin (<< 2), pysycache (<< 3.1-4~), python (<< 2.7.18), python-catkin-pkg (<< 0.4.14-2~), python-chardet (<< 3.0.4-6~), python-dbg (<< 2.7.18), python-dev (<< 2.7.18), python-extras (<< 1.0.0-4~), python-fixtures (<< 3.0.0-3~), python-genpy (<< 0.6.9-2~), python-iso8601 (<< 0.1.12-2~), python-linecache2 (<< 1.0.0-4~), python-minimal (<< 2.7.18), python-pbr (<< 5.4.5), python-pyasn1 (<< 0.4.2-4~), python-pygame (<< 1.9.6+dfsg-3~), python-pyicu (<< 2.2-3~), python-rospkg (<< 1.1.10-2~), python-std-msgs (<< 0.5.12-2~), python-testtools (<< 2.3.0-7~), python-traceback2 (<< 1.4.0-6~), python-traitlets (<< 4.3.3-3~), python-urllib3 (<< 1.25.8-2~), python-yaml (<< 5.3.1-2~)
Replaces: libpython2.7-testsuite (<< 2.7.13-4), python2.7 (<< 2.7.5-0~)
Download-Size: 1,797 kB
APT-Manual-Installed: no
APT-Sources: http://raspbian.raspberrypi.org/raspbian bookworm/main armhf Packages
Description: Interactive high-level object-oriented language (standard library, version 2.7)
 Python is a high-level, interactive, object-oriented language. Its 2.7 version
 includes an extensive class library with lots of goodies for
 network programming, system administration, sounds and graphics.
 .
 This package contains Python 2.7's standard library. It is normally not
 used on its own, but as a dependency of python2.7.

@jvonau
Copy link
Contributor Author

jvonau commented Apr 11, 2023

And it installs too

jerryv@box:~ $ sudo apt install python2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python2-minimal python2.7 python2.7-minimal
Suggested packages:
  python2-doc python-tk python2.7-doc binfmt-support
The following NEW packages will be installed:
  libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python2 python2-minimal python2.7 python2.7-minimal
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,631 kB of archives.
After this operation, 16.6 MB of additional disk space will be used.
Get:1 https://mirrors.switch.ca/raspbian/raspbian bookworm/main armhf libpython2.7-minimal armhf 2.7.18-13.2 [397 kB]
Get:2 https://mirrors.switch.ca/raspbian/raspbian bookworm/main armhf python2.7-minimal armhf 2.7.18-13.2 [1,046 kB]
Get:3 https://mirrors.switch.ca/raspbian/raspbian bookworm/main armhf python2-minimal armhf 2.7.18-3 [34.2 kB]
Get:4 https://mirrors.switch.ca/raspbian/raspbian bookworm/main armhf libpython2.7-stdlib armhf 2.7.18-13.2 [1,797 kB]
Get:5 https://mirrors.switch.ca/raspbian/raspbian bookworm/main armhf python2.7 armhf 2.7.18-13.2 [311 kB]
Get:6 https://mirrors.switch.ca/raspbian/raspbian bookworm/main armhf libpython2-stdlib armhf 2.7.18-3 [21.2 kB]
Get:7 https://mirrors.switch.ca/raspbian/raspbian bookworm/main armhf python2 armhf 2.7.18-3 [24.5 kB]
Fetched 3,631 kB in 3s (1,109 kB/s) 
Selecting previously unselected package libpython2.7-minimal:armhf.
(Reading database ... 82616 files and directories currently installed.)
Preparing to unpack .../0-libpython2.7-minimal_2.7.18-13.2_armhf.deb ...
Unpacking libpython2.7-minimal:armhf (2.7.18-13.2) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../1-python2.7-minimal_2.7.18-13.2_armhf.deb ...
Unpacking python2.7-minimal (2.7.18-13.2) ...
Selecting previously unselected package python2-minimal.
Preparing to unpack .../2-python2-minimal_2.7.18-3_armhf.deb ...
Unpacking python2-minimal (2.7.18-3) ...
Selecting previously unselected package libpython2.7-stdlib:armhf.
Preparing to unpack .../3-libpython2.7-stdlib_2.7.18-13.2_armhf.deb ...
Unpacking libpython2.7-stdlib:armhf (2.7.18-13.2) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../4-python2.7_2.7.18-13.2_armhf.deb ...
Unpacking python2.7 (2.7.18-13.2) ...
Selecting previously unselected package libpython2-stdlib:armhf.
Preparing to unpack .../5-libpython2-stdlib_2.7.18-3_armhf.deb ...
Unpacking libpython2-stdlib:armhf (2.7.18-3) ...
Setting up libpython2.7-minimal:armhf (2.7.18-13.2) ...
Setting up python2.7-minimal (2.7.18-13.2) ...
Linking and byte-compiling packages for runtime python2.7...
Setting up python2-minimal (2.7.18-3) ...
Selecting previously unselected package python2.
(Reading database ... 83363 files and directories currently installed.)
Preparing to unpack .../python2_2.7.18-3_armhf.deb ...
Unpacking python2 (2.7.18-3) ...
Setting up libpython2.7-stdlib:armhf (2.7.18-13.2) ...
Setting up python2.7 (2.7.18-13.2) ...
Setting up libpython2-stdlib:armhf (2.7.18-3) ...
Setting up python2 (2.7.18-3) ...
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for mailcap (3.70+nmu1) ...

@jvonau
Copy link
Contributor Author

jvonau commented Apr 11, 2023

installing ansible might be a pain

Create virtual environment for Ansible
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting ansible-core
  Using cached https://www.piwheels.org/simple/ansible-core/ansible_core-2.14.4-py3-none-any.whl (2.2 MB)
Collecting jinja2>=3.0.0
  Using cached https://www.piwheels.org/simple/jinja2/Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting PyYAML>=5.1
  Downloading PyYAML-6.0.tar.gz (124 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 125.0/125.0 kB 1.2 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting cryptography
  Downloading cryptography-40.0.1.tar.gz (624 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 625.0/625.0 kB 3.1 MB/s eta 0:00:00
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [77 lines of output]
      Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://www.piwheels.org/simple
      Collecting setuptools!=60.9.0,>=40.6.0
        Using cached https://www.piwheels.org/simple/setuptools/setuptools-67.6.1-py3-none-any.whl (1.1 MB)
      Collecting wheel
        Using cached https://www.piwheels.org/simple/wheel/wheel-0.40.0-py3-none-any.whl (64 kB)
      Collecting cffi>=1.12
        Downloading cffi-1.15.1.tar.gz (508 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 508.5/508.5 kB 3.1 MB/s eta 0:00:00
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Collecting setuptools-rust>=0.11.4
        Downloading https://www.piwheels.org/simple/setuptools-rust/setuptools_rust-1.5.2-py3-none-any.whl (23 kB)
      Collecting pycparser
        Using cached https://www.piwheels.org/simple/pycparser/pycparser-2.21-py2.py3-none-any.whl (119 kB)
      Collecting semantic-version<3,>=2.8.2
        Downloading https://www.piwheels.org/simple/semantic-version/semantic_version-2.10.0-py2.py3-none-any.whl (19 kB)
      Collecting typing-extensions>=3.7.4.3
        Downloading https://www.piwheels.org/simple/typing-extensions/typing_extensions-4.5.0-py3-none-any.whl (27 kB)
      Installing collected packages: wheel, typing-extensions, setuptools, semantic-version, pycparser, setuptools-rust, cffi
        DEPRECATION: cffi 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 cffi: started
        Running setup.py install for cffi: finished with status 'error'
        error: subprocess-exited-with-error
      
        × Running setup.py install for cffi did not run successfully.
        │ exit code: 1
        ╰─> [40 lines of output]
            /usr/local/ansible/lib/python3.11/site-packages/setuptools/config/setupcfg.py:515: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
              warnings.warn(msg, warning_class)
            running install
            /usr/local/ansible/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/cffi
            copying cffi/lock.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/cparser.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/verifier.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/vengine_gen.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/backend_ctypes.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/vengine_cpy.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/setuptools_ext.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/error.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/cffi_opcode.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/__init__.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/model.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/pkgconfig.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/recompiler.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/api.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/ffiplatform.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/commontypes.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/_cffi_include.h -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/parse_c_type.h -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/_embedding.h -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/_cffi_errors.h -> build/lib.linux-aarch64-cpython-311/cffi
            running build_ext
            building '_cffi_backend' extension
            creating build/temp.linux-aarch64-cpython-311
            creating build/temp.linux-aarch64-cpython-311/c
            arm-linux-gnueabihf-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/local/ansible/include -I/usr/include/python3.11 -c c/_cffi_backend.c -o build/temp.linux-aarch64-cpython-311/c/_cffi_backend.o
            c/_cffi_backend.c:2:10: fatal error: Python.h: No such file or directory
                2 | #include <Python.h>
                  |          ^~~~~~~~~~
            compilation terminated.
            error: command '/usr/bin/arm-linux-gnueabihf-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.
      ╰─> cffi
      
      note: This is an issue with the package mentioned above, not pip.
      hint: See above for output from the failure.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

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

Note the -aarch64- in the above suggests that python's pip is using uname while the userspace is armhf

jerryv@box:/opt/iiab/iiab $ dpkg --print-architecture 
armhf

Lets see where is goes in a few days and see if a python3.11 (cp311) wheel is created for cffi on piwheels

@holta
Copy link
Member

holta commented Apr 11, 2023

@jvonau should @EMG70 wait a few days before testing 32-bit RasPiOS ?

@jvonau
Copy link
Contributor Author

jvonau commented Apr 11, 2023

Don't try until there is a new wheel with cp311 within the name in the above url.

@EMG70
Copy link
Contributor

EMG70 commented Apr 12, 2023

Don't try until there is a new wheel with cp311 within the name in the above url.

Noted Jerry,Thanks

@holta
Copy link
Member

holta commented Jul 30, 2023

@holta
Copy link
Member

holta commented Sep 7, 2023

Don't try until there is a new wheel with cp311 within the name in the above url.

Done, 5 months later! 💯

Where CFFI = C Foreign Function Interface

https://www.piwheels.org/simple/cffi/cffi-1.15.1-cp311-cp311-linux_armv7l.whl#sha256=b7d4d03d3abebb8b6623c14c20e2f9defec95aabde9f5e8999af483eeab7ae18

https://www.piwheels.org/simple/cffi/cffi-1.15.1-cp311-cp311-linux_armv6l.whl#sha256=b7d4d03d3abebb8b6623c14c20e2f9defec95aabde9f5e8999af483eeab7ae18

@EMG70 let's do a LARGE-sized install onto the latest pre-release of "Raspberry Pi OS 12" (desktop version ideally? or Lite version?) if you have time in the coming 10 days!

@holta
Copy link
Member

holta commented Sep 7, 2023

sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list

  1. @EMG70 in addition to the above, at that time I recommend you also run:

    sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list.d/raspi.list

  2. After your OS upgrade from RasPiOS 11 Lite to RasPiOS 12 Lite is completed, try to install SMALL-sized IIAB with PR scripts/ansible: Evaluate upstream piwheels / cryptography fix on "32-bit" RasPiOS 12 Lite [pinning to cryptography 40.0.1 no longer nec!] [create /etc/pip.conf missing from RasPiOS as nec, to avoid cffi glitch] #3632 as follows:

    curl iiab.io/install.txt | bash -s 3632

  3. If your IIAB install on "32-bit" RasPiOS 12 Lite works, please also test your microSD card in a truly 32-bit Raspberry Pi Zero W if you have one (to check the Wi-Fi hotspot works well!)

Just FYI if you run apt update immediately after the OS upgrade to RasPiOS 12 (Bookworm), you'll likely see something like:

N: Repository 'Debian bookworm' changed its 'non-free component' value from 'non-free' to 'non-free non-free-firmware'
N: More information about this can be found online in the Release notes at: https://www.debian.org/releases/bookworm/arm64/release-notes/ch-information.html#non-free-split

@holta
Copy link
Member

holta commented Sep 8, 2023

CFFI issues persist for @EMG70 on today's new test on "32-bit" (sort of!) RasPiOS 12 Lite:

IMG-20230908-WA0004

(He should post iiab-diagnostics shortly to give a bit more context!)

@holta
Copy link
Member

holta commented Sep 8, 2023

Same issue seems to occur with cryptography 40.0.1 too :/

And @EMG70 also tried booting "32-bit" RasPiOS 12 Lite (pre-release) on his RPi 400 in true 32-bit mode, by doing:

echo 'arm_64bit=0' >> /boot/config.txt
reboot

In short, he tried both kinds of boots (32-bit armv7l kernel and 64-bit aarch64 kernel, per #3516) each running on RPi 400, and no luck in either case, even when avoiding PR #3632. CLARIF: each time, he saved the "32-bit" RasPiOS 12 Lite pre-release test OS, using techniques like the following:

mv /etc/iiab /etc/iiab.old
mv /opt/iiab/iiab /opt/iiab/iiab.old
mv /usr/local/ansible /usr/local/ansible.old
sudo iiab

A bit more detail in this screenshot below, showing what appears almost immediately as/after scripts/ansible tries to install cryptography 40.0.1 to the new /usr/local/ansible venv:

c79fb206-42b6-41d8-a178-0b9c9f9d13f9

@holta
Copy link
Member

holta commented Sep 9, 2023

FYI @EMG70 and I intend to give "32-bit" RasPiOS 12 (Bookworm) another crack on Friday September 22:

Whether or not cffi wheel for Python 3.11 shows improvement here... ?

@holta
Copy link
Member

holta commented Sep 9, 2023

Full paste of the latest cffi error on a fresh "32-bit" RasPiOS 12 Lite below — running with a 64-bit kernel in this case — in the hope this helps us & all move the ball forward:

OS/Architecture/Prep Details
root@raspberrypi:~# cat /etc/issue
Raspbian GNU/Linux 12 \n \l

root@raspberrypi:~# cat /etc/rpi-issue
Raspberry Pi reference 2023-05-03
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 47eee1f0ddcf8811559d51eea1c1bb48335e3e88, stage2

root@raspberrypi:~# uname -a
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

root@raspberrypi:~# tail -1 /proc/cpuinfo
Model           : Raspberry Pi 4 Model B Rev 1.1

root@raspberrypi:~# apt install python3-venv
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  python3-distutils python3-lib2to3 python3-pip-whl python3-setuptools-whl python3.11-venv
The following NEW packages will be installed:
  python3-distutils python3-lib2to3 python3-pip-whl python3-setuptools-whl python3-venv python3.11-venv
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,043 kB of archives.
After this operation, 4,197 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://raspbian.mirror.constant.com/raspbian bookworm/main armhf python3-lib2to3 all 3.11.2-3 [76.3 kB]
Get:2 http://raspbian.mirror.constant.com/raspbian bookworm/main armhf python3-distutils all 3.11.2-3 [131 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian bookworm/main armhf python3-pip-whl all 23.0.1+dfsg-1 [1,717 kB]
Get:4 http://raspbian.mirror.constant.com/raspbian bookworm/main armhf python3-setuptools-whl all 66.1.1-1 [1,111 kB]
Get:6 http://raspbian.raspberrypi.org/raspbian bookworm/main armhf python3-venv armhf 3.11.2-1 [1,188 B]
Get:5 http://raspbian.mirror.constant.com/raspbian bookworm/main armhf python3.11-venv armhf 3.11.2-6 [5,892 B]
Fetched 3,043 kB in 2s (1,409 kB/s)
Selecting previously unselected package python3-lib2to3.
(Reading database ... 44873 files and directories currently installed.)
Preparing to unpack .../0-python3-lib2to3_3.11.2-3_all.deb ...
Unpacking python3-lib2to3 (3.11.2-3) ...
Selecting previously unselected package python3-distutils.
Preparing to unpack .../1-python3-distutils_3.11.2-3_all.deb ...
Unpacking python3-distutils (3.11.2-3) ...
Selecting previously unselected package python3-pip-whl.
Preparing to unpack .../2-python3-pip-whl_23.0.1+dfsg-1_all.deb ...
Unpacking python3-pip-whl (23.0.1+dfsg-1) ...
Selecting previously unselected package python3-setuptools-whl.
Preparing to unpack .../3-python3-setuptools-whl_66.1.1-1_all.deb ...
Unpacking python3-setuptools-whl (66.1.1-1) ...
Selecting previously unselected package python3.11-venv.
Preparing to unpack .../4-python3.11-venv_3.11.2-6_armhf.deb ...
Unpacking python3.11-venv (3.11.2-6) ...
Selecting previously unselected package python3-venv.
Preparing to unpack .../5-python3-venv_3.11.2-1_armhf.deb ...
Unpacking python3-venv (3.11.2-1) ...
Setting up python3-setuptools-whl (66.1.1-1) ...
Setting up python3-pip-whl (23.0.1+dfsg-1) ...
Setting up python3-lib2to3 (3.11.2-3) ...
Setting up python3-distutils (3.11.2-3) ...
Setting up python3.11-venv (3.11.2-6) ...
Setting up python3-venv (3.11.2-1) ...

root@raspberrypi:~# python3 -m venv /usr/local/ansible
root@raspberrypi:~# /usr/local/ansible/bin/python3 -m pip install --upgrade ansible-core
Collecting ansible-core
  Downloading ansible_core-2.15.3-py3-none-any.whl (2.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.2/2.2 MB 5.8 MB/s eta 0:00:00
Collecting jinja2>=3.0.0
  Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 2.6 MB/s eta 0:00:00
Collecting PyYAML>=5.1
  Downloading PyYAML-6.0.1.tar.gz (125 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 125.2/125.2 kB 3.7 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting cryptography
  Downloading cryptography-41.0.3.tar.gz (630 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 630.1/630.1 kB 6.7 MB/s eta 0:00:00
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [97 lines of output]
      Collecting setuptools>=61.0.0
        Using cached setuptools-68.2.0-py3-none-any.whl (807 kB)
      Collecting wheel
        Using cached wheel-0.41.2-py3-none-any.whl (64 kB)
      Collecting cffi>=1.12
        Downloading cffi-1.15.1.tar.gz (508 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 508.5/508.5 kB 4.2 MB/s eta 0:00:00
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Collecting setuptools-rust>=0.11.4
        Downloading setuptools_rust-1.7.0-py3-none-any.whl (25 kB)
      Collecting pycparser
        Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 1.8 MB/s eta 0:00:00
      Collecting semantic-version<3,>=2.8.2
        Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
      Collecting typing-extensions>=3.7.4.3
        Downloading typing_extensions-4.7.1-py3-none-any.whl (33 kB)
      Installing collected packages: wheel, typing-extensions, setuptools, semantic-version, pycparser, setuptools-rust, cffi
        DEPRECATION: cffi 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 cffi: started
        Running setup.py install for cffi: finished with status 'error'
        error: subprocess-exited-with-error

        × Running setup.py install for cffi did not run successfully.
        │ exit code: 1
        ╰─> [60 lines of output]
            Package libffi was not found in the pkg-config search path.
            Perhaps you should add the directory containing `libffi.pc'
            to the PKG_CONFIG_PATH environment variable
            Package 'libffi', required by 'virtual:world', not found
            Package libffi was not found in the pkg-config search path.
            Perhaps you should add the directory containing `libffi.pc'
            to the PKG_CONFIG_PATH environment variable
            Package 'libffi', required by 'virtual:world', not found
            Package libffi was not found in the pkg-config search path.
            Perhaps you should add the directory containing `libffi.pc'
            to the PKG_CONFIG_PATH environment variable
            Package 'libffi', required by 'virtual:world', not found
            Package libffi was not found in the pkg-config search path.
            Perhaps you should add the directory containing `libffi.pc'
            to the PKG_CONFIG_PATH environment variable
            Package 'libffi', required by 'virtual:world', not found
            Package libffi was not found in the pkg-config search path.
            Perhaps you should add the directory containing `libffi.pc'
            to the PKG_CONFIG_PATH environment variable
            Package 'libffi', required by 'virtual:world', not found
            /usr/local/ansible/lib/python3.11/site-packages/setuptools/config/setupcfg.py:515: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
              warnings.warn(msg, warning_class)
            running install
            /usr/local/ansible/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/cffi
            copying cffi/error.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/__init__.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/commontypes.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/lock.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/pkgconfig.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/setuptools_ext.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/ffiplatform.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/backend_ctypes.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/vengine_gen.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/model.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/api.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/verifier.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/cffi_opcode.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/recompiler.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/vengine_cpy.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/cparser.py -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/_cffi_include.h -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/parse_c_type.h -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/_embedding.h -> build/lib.linux-aarch64-cpython-311/cffi
            copying cffi/_cffi_errors.h -> build/lib.linux-aarch64-cpython-311/cffi
            running build_ext
            building '_cffi_backend' extension
            creating build/temp.linux-aarch64-cpython-311
            creating build/temp.linux-aarch64-cpython-311/c
            arm-linux-gnueabihf-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/ansible/include -I/usr/include/python3.11 -c c/_cffi_backend.c -o build/temp.linux-aarch64-cpython-311/c/_cffi_backend.o
            c/_cffi_backend.c:2:10: fatal error: Python.h: No such file or directory
                2 | #include <Python.h>
                  |          ^~~~~~~~~~
            compilation terminated.
            error: command '/usr/bin/arm-linux-gnueabihf-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.
      ╰─> cffi

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

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

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

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

@holta
Copy link
Member

holta commented Sep 10, 2023

@EMG70 I've posted upstream to make sure we stay on track with RasPiOS12 — as it evolves towards final release / general availability — presumably very quickly now in coming weeks:

@holta
Copy link
Member

holta commented Sep 11, 2023

@holta holta changed the title How to pre-test RasPiOS 12 [cffi wheel for Python 3.11 now exists, but fails] How to pre-test RasPiOS 12 [cffi wheel for Python 3.11 now exists] Sep 11, 2023
@holta
Copy link
Member

holta commented Sep 26, 2023

@EMG70 just FYI the Calibre-Web install issue on RasPiOS Bookworm (#3642) appears under control now, but might still be further improved as it converges here:

So let's test everything we can carefully on/around Friday 2023-10-06 if you have time to help then, as RasPiOS 12 is making big strides behind the scenes, and presumably is now on final approach very soon!

@EMG70
Copy link
Contributor

EMG70 commented Sep 26, 2023

@EMG70 just FYI the Calibre-Web install issue on RasPiOS Bookworm (#3642) appears under control now, but might still be further improved as it converges here:

So let's test everything we can carefully on/around Friday 2023-10-06 if you have time to help then, as RasPiOS 12 is making big strides behind the scenes, and presumably is now on final approach very soon!

No problem. I will get in touch a few days before 06/10/23.

@holta
Copy link
Member

holta commented Sep 26, 2023

No problem. I will get in touch a few days before 06/10/23.

Awesome. ASIDE / lots of grassroots folk are now testing pre-release Raspberry Pi OS Bookworm, so hopefully that means it'll be quite solid when it's released in coming-weeks-or-so — many months after Debian 12 Bookworm itself was released on 2023-06-10:

@holta
Copy link
Member

holta commented Sep 26, 2023

@EMG70 just FYI the Calibre-Web install issue on RasPiOS Bookworm (#3642) appears under control now, but might still be further improved as it converges here:

Awesome News: https://piwheels.org just fixed it (lxml 4.9.3 for Python 3.11) today after I pinged them about this failed build!

@holta holta changed the title How to pre-test RasPiOS 12 [cffi wheel for Python 3.11 now exists] How to pre-test RasPiOS 12 [cffi, cryptography, lxml "wheels" for Python 3.11 now exist!] Sep 26, 2023
@holta
Copy link
Member

holta commented Oct 5, 2023

Two generally very successful RasPiOS 12/Bookworm pre-release tests — huge thanks to @EMG70. FYI he used graphical desktop versions of RasPiOS in both cases — each tested with a LARGE-sized IIAB install:

  1. Fully 32-bit OS (using arm_64bit=0 in /boot/config.txt per Strange switch to 64bit kernel on 32bit RasPiOS [on 64-bit CPU architectures] #3516) on RPi 400:
    http://sprunge.us/H36mDb?en

  2. 32-bit OS with 64-bit kernel / user space, on RPi 4:
    http://sprunge.us/oGYxI6?en

There were a few errors like Error: NetworkManager is not running. — in both cases above — when running sudo iiab-network as this fully 32-bit screenshot shows:

IMG-20231005-WA0030~2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants