diff --git a/infra/base-images/base-builder/compile b/infra/base-images/base-builder/compile index 5955a315ac70..ad6c3ea1b41d 100755 --- a/infra/base-images/base-builder/compile +++ b/infra/base-images/base-builder/compile @@ -298,12 +298,6 @@ else BUILD_CMD="bash -eux $SRC/build.sh $@" fi -# If there are cdb (compilation database) fragments saved, restore them to $OUT -# before building. -if [ -d /cdb ]; then - cp -rT /cdb $OUT/cdb -fi - # Set +u temporarily to continue even if GOPATH and OSSFUZZ_RUSTPATH are undefined. set +u # We need to preserve source code files for generating a code coverage report. diff --git a/infra/build/functions/build_project.py b/infra/build/functions/build_project.py index 5aa75588c1c2..6428ab42010d 100755 --- a/infra/build/functions/build_project.py +++ b/infra/build/functions/build_project.py @@ -184,6 +184,8 @@ def __init__(self, name, project_yaml, dockerfile): else: self.main_repo = '' + self.indexer_targets = project_yaml.get('indexer', {}).get('targets', []) + # This is set to enable build infra to use cached images (which are # specific to a sanitizer). # TODO: find a better way to handle this. @@ -521,13 +523,13 @@ def _create_indexed_build_steps(project, build, timestamp, env, + indexer_targets, build_type='indexer'): """Creates the build steps for a specific indexer type.""" if build_type == 'indexer': container_name = _INDEXED_CONTAINER_NAME image_name = _indexer_built_image_name(project.name) build_script_command = '/opt/indexer/index_build.py' - # Save the CDB fragments so we can re-use them for rebuilding indexes. elif build_type == 'tracer': container_name = _TRACING_CONTAINER_NAME image_name = _tracer_built_image_name(project.name) @@ -536,6 +538,9 @@ def _create_indexed_build_steps(project, else: raise ValueError(f'Unknown build_type: {build_type}') + if indexer_targets: + build_script_command += ' ' + ','.join(indexer_targets) + command_sequence = [ 'cd /src', f'cd {project.workdir}', @@ -543,7 +548,6 @@ def _create_indexed_build_steps(project, build_script_command, # Enable re-building both the project and the indexes. 'cp -n /usr/local/bin/replay_build.sh $$SRC/', - 'cp -r $$OUT/cdb /cdb', # Link /out to the actual $OUT and actually create it in the container's # filesystem since it's a mount. 'rm -rf /out && ln -s $$OUT /out', @@ -647,12 +651,14 @@ def get_indexer_build_steps(project_name, build, timestamp, env, + project.indexer_targets, build_type='indexer') tracer_steps = _create_indexed_build_steps(project, build, timestamp, env, + project.indexer_targets, build_type='tracer') return build_steps + indexer_steps + tracer_steps diff --git a/infra/presubmit.py b/infra/presubmit.py index 0ec2194e2e95..ffac046a50ca 100755 --- a/infra/presubmit.py +++ b/infra/presubmit.py @@ -103,6 +103,7 @@ class ProjectYamlChecker: 'vendor_ccs', 'view_restrictions', 'file_github_issue', + 'indexer', # Flags specific to infra/indexer. ] REQUIRED_SECTIONS = ['main_repo'] diff --git a/projects/v8/project.yaml b/projects/v8/project.yaml index 6f24ace482e6..e29235b956d5 100644 --- a/projects/v8/project.yaml +++ b/projects/v8/project.yaml @@ -4,4 +4,8 @@ main_repo: "https://chromium.googlesource.com/v8/v8" fuzzing_engines: - none sanitizers: - - address \ No newline at end of file + - address + +indexer: + targets: + - d8