c56bef871b
CodeQL / Analyze (python) (push) Has been cancelled
Update Platform Components Table / update (push) Has been cancelled
Docker image release / Build base image (push) Has been cancelled
Sync docs with Docusaurus / sync (push) Has been cancelled
Tests / Check if changed (push) Has been cancelled
Tests / format (push) Has been cancelled
Tests / check-imports (push) Has been cancelled
Tests / Unit / macos-latest (push) Has been cancelled
Tests / Unit / ubuntu-latest (push) Has been cancelled
Tests / Unit / windows-latest (push) Has been cancelled
Tests / mypy (push) Has been cancelled
Tests / Integration / ubuntu-latest (push) Has been cancelled
Tests / Integration / macos-latest (push) Has been cancelled
Tests / Integration / windows-latest (push) Has been cancelled
Tests / notify-slack-on-failure (push) Has been cancelled
Tests / Mark tests as completed (push) Has been cancelled
27 lines
1.1 KiB
Bash
Executable File
27 lines
1.1 KiB
Bash
Executable File
#!/bin/bash -eu
|
|
# SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai>
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Builds the Atheris fuzz targets for ClusterFuzzLite / OSS-Fuzz.
|
|
# `compile_python_fuzzer` is provided by the base-builder-python image.
|
|
|
|
python3 -m pip install --upgrade pip
|
|
pip3 install . --uploaded-prior-to=P1D
|
|
|
|
for harness in "$SRC"/haystack/test/fuzz/fuzz_*.py; do
|
|
name=$(basename "$harness" .py)
|
|
# --collect-submodules numpy: PyInstaller's static analysis misses NumPy's
|
|
# dynamically-loaded submodules (e.g. numpy._core._exceptions), which makes
|
|
# the frozen binary crash on startup ("ModuleNotFoundError") and fails the
|
|
# ClusterFuzzLite bad-build check. Bundling all numpy submodules avoids that.
|
|
compile_python_fuzzer "$harness" --collect-submodules numpy
|
|
|
|
# Ship a seed corpus if one exists for this harness. The runner unpacks
|
|
# "<fuzzer>_seed_corpus.zip" next to the binary and seeds libFuzzer with it.
|
|
corpus_dir="$SRC/haystack/test/fuzz/corpus/$name"
|
|
if [ -d "$corpus_dir" ]; then
|
|
zip -j "$OUT/${name}_seed_corpus.zip" "$corpus_dir"/*
|
|
fi
|
|
done
|