• Home
  • Raw
  • Download

Lines Matching +full:project +full:- +full:src +full:- +full:path

7 #      http://www.apache.org/licenses/LICENSE-2.0
45 """Repo of base-builder images."""
60 return self.digests[index - 1]
62 logging.error('Failed to find suitable base-builder.')
67 """Replace gitdir with a relative path."""
75 if not os.path.isabs(absolute_path):
79 current_dir = os.path.dirname(file_path)
80 # Rebase to /src rather than the host src dir.
81 base_dir = current_dir.replace(src_dir, '/src')
82 relative_path = os.path.relpath(absolute_path, base_dir)
101 file_path = os.path.join(root_dir, filename)
106 """Replace the base-builder digest in a Dockerfile."""
113 line = 'FROM gcr.io/oss-fuzz-base/base-builder@' + digest + '\n'
122 """Copy /src from docker to the host."""
123 # Copy /src to host.
124 image_name = 'gcr.io/oss-fuzz/' + project_name
125 src_dir = os.path.join(host_dir, 'src')
126 if os.path.exists(src_dir):
130 '-v',
134 '-r',
135 '-p',
136 '/src',
150 return helper.build_image_impl(helper.Project(project_name))
160 post_run_pattern = re.compile(r'\s*RUN\s*(.*build\.sh.*(\$SRC|/src).*)')
180 # pylint: disable=too-many-locals
186 """Builds a OSS-Fuzz fuzzer at a specific commit SHA.
190 build_repo_manager: The OSS-Fuzz project's repo manager to be built at.
191 build_data: A struct containing project build information.
200 # Re-copy /src for a clean checkout every time.
202 os.path.dirname(host_src_path))
205 projects_dir = os.path.join('projects', build_data.project_name)
206 dockerfile_path = os.path.join(projects_dir, 'Dockerfile')
213 logging.info('Running post-checkout step `%s` in %s.', post_checkout_step,
216 '-w',
218 '-v',
219 host_src_path + ':' + '/src',
220 'gcr.io/oss-fuzz/' + build_data.project_name,
222 '-c',
226 project = helper.Project(build_data.project_name)
227 result = helper.build_fuzzers_impl(project=project,
234 mount_path='/src')
238 # Retry with an OSS-Fuzz builder container that's closer to the project
242 # Find first change in the projects/<PROJECT> directory before the project
245 'log', '--before=' + commit_date.isoformat(), '-n1', '--format=%H',
252 'Could not find first OSS-Fuzz commit prior to upstream commit. '
257 ['log', '--reverse', '--format=%H', projects_dir], check_result=True)
265 logging.info('Build failed. Retrying on earlier OSS-Fuzz commit %s.',
268 # Check out projects/<PROJECT> dir to the commit that was found.
272 # Also use the closest base-builder we can find.
278 logging.info('Using base-builder with digest %s.', base_builder_digest)
281 # Rebuild image and re-copy src dir since things in /src could have changed.
293 """Checks a docker image for the main repo of an OSS-Fuzz project.
298 project_name: The name of the oss-fuzz project.
299 repo_name: The name of the main repo in an OSS-Fuzz project.
303 A tuple containing (the repo's origin, the repo's path).
314 # Change to oss-fuzz main directory so helper.py runs correctly.
319 docker_image_name = 'gcr.io/oss-fuzz/' + project_name
321 'docker', 'run', '--rm', '-t', docker_image_name, 'python3',
322 os.path.join('/opt', 'cifuzz', 'detect_repo.py')
325 command_to_run.extend(['--repo_name', repo_name])
327 command_to_run.extend(['--example_commit', commit])
338 """Get base-image digests."""
341 logging.warning('gcloud not found in PATH.')
348 'list-tags',
349 'gcr.io/oss-fuzz-base/base-builder',
350 '--format=json',
351 '--sort-by=timestamp',
371 parser.add_argument('--project_name',
372 help='The name of the project where the bug occurred.',
374 parser.add_argument('--commit',
377 parser.add_argument('--engine',
380 parser.add_argument('--sanitizer',
383 parser.add_argument('--architecture', default='x86_64')
395 os.path.join(host_src_dir, os.path.basename(repo_path)))