Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions infra/base-images/base-builder/compile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 8 additions & 2 deletions infra/build/functions/build_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand All @@ -536,14 +538,16 @@ 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}',
f'mkdir -p {build.out}',
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',
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions infra/presubmit.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class ProjectYamlChecker:
'vendor_ccs',
'view_restrictions',
'file_github_issue',
'indexer', # Flags specific to infra/indexer.
]

REQUIRED_SECTIONS = ['main_repo']
Expand Down
6 changes: 5 additions & 1 deletion projects/v8/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ main_repo: "https://chromium.googlesource.com/v8/v8"
fuzzing_engines:
- none
sanitizers:
- address
- address

indexer:
targets:
- d8
Loading