Skip to content

Commit 9367a9c

Browse files
authoredSep 25, 2024··
[connectedhomeip] Upgrade python version to 3.10 (#12533)
- OSS-Fuzz builds are failing after pigweed was rebased in project-chip/connectedhomeip#35644 - One of the failures is related to pigweed becoming incompatible with python <3.9. Such as using subscript notation in the type hints. - Fix: Base images in OSS-Fuzz use python 3.8, This PR aims to force the usage of python3.10 instead ### Example Error ``` Step #1: Traceback (most recent call last): Step #1: File "../../third_party/pigweed/repo/pw_build/py/pw_build/python_runner.py", line 38, in <module> Step #1: import gn_resolver # type: ignore Step #1: File "/src/connectedhomeip/third_party/pigweed/repo/pw_build/py/pw_build/gn_resolver.py", line 319, in <module> Step #1: _Actions = Iterator[tuple[_ArgAction, str]] Step #1: TypeError: 'type' object is not subscriptable Step #1: [137/1234] ln -f ../../third_party/pigweed/repo/pw_thread/pw_thread_protos/thread_snapshot_service.proto ```
1 parent cc0ca96 commit 9367a9c

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed
 

‎projects/connectedhomeip/Dockerfile

+12-6
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,25 @@ FROM gcr.io/oss-fuzz-base/base-builder
2020
# See connectedhomeip/docs/guides/BUILDING.md#prerequisites
2121
RUN apt-get update && \
2222
apt-get install -y pkg-config libssl-dev libdbus-1-dev libglib2.0-dev \
23-
libavahi-client-dev ninja-build python3-venv python3-dev python3-pip \
24-
unzip libgirepository1.0-dev libcairo2-dev libreadline-dev
23+
libavahi-client-dev ninja-build \
24+
unzip libgirepository1.0-dev libcairo2-dev libreadline-dev
25+
26+
# Installing Python3.10 and using it instead of the default Python taken from the base-builder image
27+
RUN apt-get update && \
28+
apt-get install -y software-properties-common && \
29+
add-apt-repository ppa:deadsnakes/ppa && \
30+
apt-get update && \
31+
apt-get install -y pkg-config python3.10 python3.10-dev python3.10-venv && \
32+
ln --force -s /usr/bin/python3.10 /usr/bin/python3
2533

2634
# Ensure python that was just installed gets precedence over
2735
# the one already installed in /usr/local/bin
2836
ENV PATH="/usr/bin/:${PATH}"
2937

30-
# This fixes setuptools bug related to version 71
31-
# https://github.com/pypa/setuptools/issues/4483
32-
RUN pip install -U packaging
38+
RUN python3 -m ensurepip --upgrade
3339

3440
# PEP-517 needed for cryptography. Update pip
35-
RUN pip3 install --upgrade pip setuptools wheel
41+
RUN python3 -m pip install --upgrade pip setuptools wheel
3642

3743
# Install Rust for building `cryptography` python package when bootstraping pigweed
3844
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

0 commit comments

Comments
 (0)
Please sign in to comment.