Skip to content

Commit

Permalink
target_experiment: Properly propagate real name. (google#12692)
Browse files Browse the repository at this point in the history
Follow up to google#12691
  • Loading branch information
oliverchang authored Nov 6, 2024
1 parent 2c733ba commit 6fabfa4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
12 changes: 12 additions & 0 deletions infra/build/functions/build_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,18 @@ def get_build_steps( # pylint: disable=too-many-locals, too-many-statements, to
"""Returns build steps for project."""

project = Project(project_name, project_yaml, dockerfile)
return get_build_steps_for_project(project,
config,
additional_env=additional_env,
use_caching=use_caching)


def get_build_steps_for_project(project,
config,
additional_env=None,
use_caching=False):
"""Returns build steps for project."""

if project.disabled:
logging.info('Project "%s" is disabled.', project.name)
return []
Expand Down
23 changes: 9 additions & 14 deletions infra/build/functions/target_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ def run_experiment(project_name,
logging.error('Couldn\'t get project data. Skipping %s.', project_name)
return

project = build_project.Project(project_name, project_yaml,
dockerfile_contents)

if real_project_name:
# If the passed project name is not the actual OSS-Fuzz project name (e.g.
# OSS-Fuzz-Gen generated benchmark), record the real one here.
project.real_name = real_project_name

# Override sanitizers and engine because we only care about libFuzzer+ASan
# for benchmarking purposes.
build_project.set_yaml_defaults(project_yaml)
Expand All @@ -72,17 +64,20 @@ def run_experiment(project_name,

# Don't do bad build checks.
project_yaml['run_tests'] = False
project = build_project.Project(project_name, project_yaml,
dockerfile_contents)

if real_project_name:
# If the passed project name is not the actual OSS-Fuzz project name (e.g.
# OSS-Fuzz-Gen generated benchmark), record the real one here.
project.real_name = real_project_name

jcc_env = [
f'CC=clang-jcc',
f'CXX=clang++-jcc',
]
steps = build_project.get_build_steps(project_name,
project_yaml,
dockerfile_contents,
config,
additional_env=jcc_env,
use_caching=use_cached_image)
steps = build_project.get_build_steps_for_project(
project, config, additional_env=jcc_env, use_caching=use_cached_image)

build = build_project.Build('libfuzzer', 'address', 'x86_64')
local_output_path = '/workspace/output.log'
Expand Down

0 comments on commit 6fabfa4

Please sign in to comment.