aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/build_specified_commit.py
diff options
context:
space:
mode:
authorGravatar Oliver Chang <oliverchang@users.noreply.github.com>2020-04-14 11:38:23 +1000
committerGravatar GitHub <noreply@github.com>2020-04-14 11:38:23 +1000
commitaa045b9b37523ee79ee0f4971498625a8b9d0c4b (patch)
treed287f9c79d36d3e778786b3e716ac005dd4fda14 /infra/build_specified_commit.py
parent20f5e0571947d83d7f47ddef43a04706253b45c9 (diff)
Bisector fixes. (#3601)
- Copy /src from host instead of checking out repo on host. This fixes issues with dependencies in the main repo. - Add some more logging.
Diffstat (limited to 'infra/build_specified_commit.py')
-rw-r--r--infra/build_specified_commit.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/infra/build_specified_commit.py b/infra/build_specified_commit.py
index 515dae24..f4134ab8 100644
--- a/infra/build_specified_commit.py
+++ b/infra/build_specified_commit.py
@@ -29,7 +29,25 @@ BuildData = collections.namedtuple(
'BuildData', ['project_name', 'engine', 'sanitizer', 'architecture'])
-def build_fuzzers_from_commit(commit, build_repo_manager, build_data):
+def copy_src_from_docker(project_name, host_dir):
+ """Copy /src from docker to the host."""
+ # Copy /src to host.
+ image_name = 'gcr.io/oss-fuzz/' + project_name
+ docker_args = [
+ '-v',
+ host_dir + ':/out',
+ image_name,
+ 'cp',
+ '-r',
+ '/src',
+ '/out',
+ ]
+ helper.docker_run(docker_args)
+ return os.path.join(host_dir, 'src')
+
+
+def build_fuzzers_from_commit(commit, build_repo_manager, host_src_path,
+ build_data):
"""Builds a OSS-Fuzz fuzzer at a specific commit SHA.
Args:
@@ -46,9 +64,8 @@ def build_fuzzers_from_commit(commit, build_repo_manager, build_data):
sanitizer=build_data.sanitizer,
architecture=build_data.architecture,
env_to_add=None,
- source_path=build_repo_manager.repo_dir,
- mount_location=os.path.join(
- '/src', build_repo_manager.repo_name))
+ source_path=host_src_path,
+ mount_location=os.path.join('/src'))
def detect_main_repo(project_name, repo_name=None, commit=None):