diff --git a/projects/mediapipe/Dockerfile b/projects/mediapipe/Dockerfile new file mode 100644 index 000000000000..022798fdc5b2 --- /dev/null +++ b/projects/mediapipe/Dockerfile @@ -0,0 +1,31 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder + +RUN apt-get update && apt-get install -y \ + python3 python3-pip \ + zip unzip curl wget \ + && rm -rf /var/lib/apt/lists/* + +# Install Bazel via Bazelisk (mediapipe pins its bazel version via .bazelversion). +RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 \ + -o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel + +RUN git clone --depth=1 https://github.com/google-ai-edge/mediapipe.git $SRC/mediapipe + +WORKDIR $SRC/mediapipe +COPY build.sh $SRC/ diff --git a/projects/mediapipe/build.sh b/projects/mediapipe/build.sh new file mode 100755 index 000000000000..76a8b7831be7 --- /dev/null +++ b/projects/mediapipe/build.sh @@ -0,0 +1,33 @@ +#!/bin/bash -eu +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +cd $SRC/mediapipe + +# Force libc++ for both target and host bazel compiles. The OSS-Fuzz +# base-builder image's default host stdlib (libstdc++ from gcc-9 on Ubuntu +# 20.04) lacks the C++20 header that mediapipe's pinned abseil +# requires; the image's clang-22 + libc++ supports it cleanly. +export BAZEL_EXTRA_BUILD_FLAGS="\ + --cxxopt=-stdlib=libc++ \ + --linkopt=-stdlib=libc++ \ + --host_cxxopt=-stdlib=libc++ \ + --host_linkopt=-stdlib=libc++ \ + --define=MEDIAPIPE_DISABLE_GPU=1" + +# Discover all cc_fuzz_test targets across mediapipe and build their +# rules_fuzzing-generated _oss_fuzz packaging targets, placing fuzzer binaries +# in $OUT/. The wrapper handles instrumentation flags, sanitizer linkage, and +# corpus packaging automatically when used with rules_fuzzing. +bazel_build_fuzz_tests diff --git a/projects/mediapipe/project.yaml b/projects/mediapipe/project.yaml new file mode 100644 index 000000000000..8bc77b1ec8c9 --- /dev/null +++ b/projects/mediapipe/project.yaml @@ -0,0 +1,9 @@ +homepage: "https://ai.google.dev/edge/mediapipe" +language: c++ +primary_contact: "mediapipe-discuss@googlegroups.com" +main_repo: "https://github.com/google-ai-edge/mediapipe" +sanitizers: + - address +fuzzing_engines: + - libfuzzer +file_github_issue: True