Skip to content

Commit 3451d29

Browse files
authored
build_generation: Avoid redundant copying for agent approach (#1013)
This PR fixes the agent approach of the build_generation to avoid copying unused files into the oss-fuzz directory for the generated projects. --------- Signed-off-by: Arthur Chan <[email protected]>
1 parent 69afef1 commit 3451d29

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

experimental/build_generator/runner.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,17 @@ def setup_worker_project(oss_fuzz_base: str,
9191
sys.exit(1)
9292
shutil.copyfile(json_config, os.path.join(temp_project_dir, 'creds.json'))
9393

94-
# Copy over the generator
95-
files_to_copy = {
96-
'build_script_generator.py', 'manager.py', 'templates.py', 'constants.py',
97-
'file_utils.py'
98-
}
99-
for target_file in files_to_copy:
100-
shutil.copyfile(
101-
os.path.join(os.path.dirname(os.path.abspath(__file__)), target_file),
102-
os.path.join(temp_project_dir,
103-
target_file.split('/')[-1]))
94+
# Copy over the generator (only for general approach
95+
if not from_agent:
96+
files_to_copy = {
97+
'build_script_generator.py', 'manager.py', 'templates.py',
98+
'constants.py', 'file_utils.py'
99+
}
100+
for target_file in files_to_copy:
101+
shutil.copyfile(
102+
os.path.join(os.path.dirname(os.path.abspath(__file__)), target_file),
103+
os.path.join(temp_project_dir,
104+
target_file.split('/')[-1]))
104105

105106
# Build a version of the project
106107
if silent_global:

0 commit comments

Comments
 (0)