Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions projects/connectedhomeip/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,14 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder
FROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04

# Install prerequisite packages
# See connectedhomeip/docs/guides/BUILDING.md#prerequisites
RUN apt-get update && \
apt-get install -y --no-install-recommends pkg-config libssl-dev libdbus-1-dev libglib2.0-dev \
libavahi-client-dev ninja-build \
unzip libgirepository1.0-dev libcairo2-dev libreadline-dev

# Installing Python3.10 and using it instead of the default Python taken from the base-builder image
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y pkg-config python3.10 python3.10-dev python3.10-venv && \
ln --force -s /usr/bin/python3.10 /usr/bin/python3

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

RUN python3 -m ensurepip --upgrade

# PEP-517 needed for cryptography. Update pip
RUN python3 -m pip install --upgrade pip setuptools wheel packaging
apt-get install -y --no-install-recommends pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libglib2.0-0\
libavahi-client-dev ninja-build libmount-dev libblkid-dev \
unzip libgirepository1.0-dev libcairo2-dev libreadline-dev patchelf file

# Install Rust for building `cryptography` python package when bootstraping pigweed
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
Expand Down
13 changes: 13 additions & 0 deletions projects/connectedhomeip/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,16 @@ deactivate
ninja -C out/fuzz_targets fuzz_tests

cp out/fuzz_targets/tests/* $OUT/

# Copy some GLib and GIO runtime libraries into $OUT so fuzzed all-clusters app can run under OSS-Fuzz base-runner, which does not provide these libraries.
mkdir -p $OUT/lib
cp /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 $OUT/lib/
cp /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 $OUT/lib/
cp /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 $OUT/lib/
cp /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 $OUT/lib/

for f in $OUT/fuzz-*; do
file "$f" | grep -q "ELF" && patchelf --set-rpath '$ORIGIN/lib' "$f"
done
patchelf --set-rpath '$ORIGIN' $OUT/lib/*.so* 2>/dev/null

1 change: 1 addition & 0 deletions projects/connectedhomeip/project.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
homepage: "https://buildwithmatter.com/"
language: c++
primary_contact: "andreilitvin@google.com"
base_os_version: ubuntu-24-04
auto_ccs:
- "asad_haque@comcast.com"
- "lalabdulkarim@csa-iot.org"
Expand Down