diff --git a/.gitmodules b/.gitmodules index 7db2f4ae3..e69de29bb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "third_party/oss-fuzz"] - path = third_party/oss-fuzz - url = https://github.com/google/oss-fuzz.git diff --git a/analysis/test_data/pairwise_unique_coverage_heatmap-failed-diff.png b/analysis/test_data/pairwise_unique_coverage_heatmap-failed-diff.png index ba1ca5cb4..c38ed38e2 100644 Binary files a/analysis/test_data/pairwise_unique_coverage_heatmap-failed-diff.png and b/analysis/test_data/pairwise_unique_coverage_heatmap-failed-diff.png differ diff --git a/benchmarks/oss_fuzz_benchmark_integration.py b/benchmarks/oss_fuzz_benchmark_integration.py index 48123e906..8c6b69d63 100755 --- a/benchmarks/oss_fuzz_benchmark_integration.py +++ b/benchmarks/oss_fuzz_benchmark_integration.py @@ -15,14 +15,16 @@ will create benchmark.yaml as well as copy the files from OSS-Fuzz to build the benchmark.""" import argparse +import bisect import datetime from distutils import spawn from distutils import dir_util +import json import os import sys import subprocess -import json -import bisect +import tempfile + from common import utils from common import benchmark_utils @@ -30,8 +32,7 @@ from common import new_process from common import yaml_utils -OSS_FUZZ_DIR = os.path.join(utils.ROOT_DIR, 'third_party', 'oss-fuzz') -OSS_FUZZ_REPO_PATH = os.path.join(OSS_FUZZ_DIR, 'infra') +OSS_FUZZ_REPO_URL = 'https://github.com/google/oss-fuzz' OSS_FUZZ_IMAGE_UPGRADE_DATE = datetime.datetime( year=2021, month=8, day=25, tzinfo=datetime.timezone.utc) @@ -77,14 +78,10 @@ def find_digest(self, timestamp): def copy_oss_fuzz_files(project, commit_date, benchmark_dir): """Checks out the right files from OSS-Fuzz to build the benchmark based on |project| and |commit_date|. Then copies them to |benchmark_dir|.""" - if not os.path.exists(os.path.join(OSS_FUZZ_DIR, '.git')): - logs.error( - '%s is not a git repo. Try running: git submodule update --init', - OSS_FUZZ_DIR) - raise RuntimeError('%s is not a git repo.' % OSS_FUZZ_DIR) - oss_fuzz_repo_manager = GitRepoManager(OSS_FUZZ_DIR) - project_dir = os.path.join(OSS_FUZZ_DIR, 'projects', project) - try: + with tempfile.TemporaryDirectory() as oss_fuzz_dir: + oss_fuzz_repo_manager = GitRepoManager(oss_fuzz_dir) + oss_fuzz_repo_manager.git(['clone', OSS_FUZZ_REPO_URL, oss_fuzz_dir]) + project_dir = os.path.join(oss_fuzz_dir, 'projects', project) # Find an OSS-Fuzz commit that can be used to build the benchmark. _, oss_fuzz_commit, _ = oss_fuzz_repo_manager.git([ 'log', '--before=' + commit_date.isoformat(), '-n1', '--format=%H', @@ -98,8 +95,6 @@ def copy_oss_fuzz_files(project, commit_date, benchmark_dir): dir_util.copy_tree(project_dir, benchmark_dir) os.remove(os.path.join(benchmark_dir, 'project.yaml')) return True - finally: - oss_fuzz_repo_manager.git(['reset', '--hard']) def get_benchmark_name(project, fuzz_target, benchmark_name=None): diff --git a/docs/getting-started/prerequisites.md b/docs/getting-started/prerequisites.md index 2947380cb..19e1d94c1 100644 --- a/docs/getting-started/prerequisites.md +++ b/docs/getting-started/prerequisites.md @@ -23,7 +23,6 @@ Clone the FuzzBench repository to your machine by running the following command: ```bash git clone https://github.com/google/fuzzbench cd fuzzbench -git submodule update --init ``` ## Installing prerequisites diff --git a/experiment/run_experiment.py b/experiment/run_experiment.py index 3f30134fb..413184d6a 100644 --- a/experiment/run_experiment.py +++ b/experiment/run_experiment.py @@ -41,8 +41,6 @@ BENCHMARKS_DIR = os.path.join(utils.ROOT_DIR, 'benchmarks') FUZZERS_DIR = os.path.join(utils.ROOT_DIR, 'fuzzers') -OSS_FUZZ_PROJECTS_DIR = os.path.join(utils.ROOT_DIR, 'third_party', 'oss-fuzz', - 'projects') RESOURCES_DIR = os.path.join(utils.ROOT_DIR, 'experiment', 'resources') FUZZER_NAME_REGEX = re.compile(r'^[a-z][a-z0-9_]+$') EXPERIMENT_CONFIG_REGEX = re.compile(r'^[a-z0-9-]{0,30}$') @@ -56,7 +54,6 @@ r'\#*\#$|' r'\.pytest_cache/|' r'.*/test_data/|' - r'^third_party/oss-fuzz/build/|' r'^docker/generated.mk$|' r'^docs/)') _OSS_FUZZ_CORPUS_BACKUP_URL_FORMAT = ( diff --git a/third_party/oss-fuzz b/third_party/oss-fuzz deleted file mode 160000 index d39cbb5a8..000000000 --- a/third_party/oss-fuzz +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d39cbb5a8ce75f6187bd7731e0099dbd1c23a3b1