|
| 1 | +#!/bin/bash -eux |
| 2 | +# Copyright 2025 Fuzz Introspector Authors |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# |
| 16 | +################################################################################ |
| 17 | + |
| 18 | +if [ -d "oss-fuzz" ] |
| 19 | +then |
| 20 | + echo "OSS-Fuzz directory exists. Reusing existing one" |
| 21 | +else |
| 22 | + echo "Cloning oss-fuzz" |
| 23 | + git clone https://github.com/google/oss-fuzz |
| 24 | + echo "Applying diffs" |
| 25 | + cd oss-fuzz |
| 26 | + git apply --ignore-space-change --ignore-whitespace ../oss-fuzz-patches.diff |
| 27 | + echo "Done" |
| 28 | + cd ../ |
| 29 | + |
| 30 | + echo "Pulling latest base-clang OSS-Fuzz image." |
| 31 | + docker pull gcr.io/oss-fuzz-base/base-clang:latest |
| 32 | +fi |
| 33 | + |
| 34 | +echo "Building base-build, base-builder-python and base-runner for fuzz introspector" |
| 35 | +# This script should be run from the fuzz-introspector/oss_fuzz_integration folder |
| 36 | +# Copy over new post-processing |
| 37 | +rm -rf ./oss-fuzz/infra/base-images/base-builder/src |
| 38 | +cp -rf ../src ./oss-fuzz/infra/base-images/base-builder/src |
| 39 | + |
| 40 | +rm -rf ./oss-fuzz/infra/base-images/base-builder/frontends |
| 41 | +cp -rf ../frontends/ ./oss-fuzz/infra/base-images/base-builder/frontends |
| 42 | + |
| 43 | +cd oss-fuzz |
| 44 | +docker build -t gcr.io/oss-fuzz-base/base-builder infra/base-images/base-builder |
| 45 | +docker build -t gcr.io/oss-fuzz-base/base-runner infra/base-images/base-runner |
0 commit comments