diff --git a/infra/build/functions/build_lib.py b/infra/build/functions/build_lib.py index 87362d1a3544..bf75cad60353 100644 --- a/infra/build/functions/build_lib.py +++ b/infra/build/functions/build_lib.py @@ -707,7 +707,7 @@ def get_runner_image_name(test_image_suffix, base_image_tag=None): # Only add a tag if it's specified and not 'legacy', as 'legacy' implies # 'latest', which is the default behavior. if base_image_tag and base_image_tag != 'legacy': - image += ':' + base_image_tag + image += f":{base_image_tag}" return image diff --git a/infra/build/functions/build_project.py b/infra/build/functions/build_project.py index cfc14e6ac884..bf100196a65c 100755 --- a/infra/build/functions/build_project.py +++ b/infra/build/functions/build_project.py @@ -179,6 +179,7 @@ def __init__(self, name, project_yaml, dockerfile): self.labels = project_yaml['labels'] self.fuzzing_language = project_yaml['language'] self.run_tests = project_yaml['run_tests'] + self.base_os_version = project_yaml.get('base_os_version', 'legacy') if 'main_repo' in project_yaml: self.main_repo = project_yaml['main_repo'] else: @@ -488,7 +489,8 @@ def get_build_steps_for_project(project, # Generate targets list. { 'name': - build_lib.get_runner_image_name(config.test_image_suffix), + build_lib.get_runner_image_name(config.test_image_suffix, + config.base_image_tag), 'env': env, 'args': [ @@ -828,11 +830,12 @@ def parse_args(description, args): return parser.parse_args(args) -def create_config(args, build_type): +def create_config(args, build_type, base_image_tag=None): """Create a Config object from parsed command line |args|.""" upload = not args.experiment return Config(testing=args.testing, test_image_suffix=args.test_image_suffix, + base_image_tag=base_image_tag, branch=args.branch, parallel=args.parallel, upload=upload, @@ -855,7 +858,6 @@ def build_script_main(script_description, credentials = oauth2client.client.GoogleCredentials.get_application_default() error = False - config = create_config(args, build_type) for project_name in args.projects: try: project_yaml, dockerfile_contents = get_project_data(project_name) @@ -864,8 +866,13 @@ def build_script_main(script_description, error = True continue - steps = get_build_steps_func(project_name, project_yaml, - dockerfile_contents, config) + base_image_tag = project_yaml.get('base_os_version', 'legacy') + if base_image_tag == 'legacy': + base_image_tag = None + config = create_config(args, build_type, base_image_tag=base_image_tag) + + steps, _ = get_build_steps_func(project_name, project_yaml, + dockerfile_contents, config) if not steps: logging.error('No steps. Skipping %s.', project_name) error = True diff --git a/infra/build/functions/build_project_test.py b/infra/build/functions/build_project_test.py index 666bb25cd054..985ce7301db6 100644 --- a/infra/build/functions/build_project_test.py +++ b/infra/build/functions/build_project_test.py @@ -112,6 +112,45 @@ def test_get_centipede_build_steps(self, mock_url, mock_get_datetime_now, config) self.assertEqual(build_steps, expected_build_steps) + @mock.patch('build_lib.get_signed_url', return_value='test_url') + @mock.patch('build_project.get_datetime_now', + return_value=test_utils.FAKE_DATETIME) + @mock.patch('build_lib.get_unique_build_step_image_id', + return_value='UNIQUE_ID') + def test_get_build_steps_ubuntu_24_04(self, mock_url, mock_get_datetime_now, + mock_get_id): + """Test for get_build_steps with ubuntu-24-04.""" + del mock_url, mock_get_datetime_now + project_yaml_contents = ( + 'language: c++\n' + 'base_os_version: ubuntu-24-04\n' + 'sanitizers:\n' + ' - address\n' + ' - memory\n' + ' - undefined\n' + 'architectures:\n' + ' - x86_64\n' + ' - i386\n' + ' - aarch64\n' + 'main_repo: https://github.com/google/oss-fuzz.git\n') + self.fs.create_dir(test_utils.PROJECT_DIR) + test_utils.create_project_data(test_utils.PROJECT, project_yaml_contents) + + expected_build_steps_file_path = test_utils.get_test_data_file_path( + 'expected_build_steps_ubuntu_24_04.json') + self.fs.add_real_file(expected_build_steps_file_path) + with open(expected_build_steps_file_path) as expected_build_steps_file: + expected_build_steps = json.load(expected_build_steps_file) + + config = build_project.Config(upload=True) + project_yaml, dockerfile = build_project.get_project_data( + test_utils.PROJECT) + config.base_image_tag = project_yaml.get('base_os_version') + build_steps, _ = build_project.get_build_steps(test_utils.PROJECT, + project_yaml, dockerfile, + config) + self.assertEqual(build_steps, expected_build_steps) + if __name__ == '__main__': unittest.main(exit=False) diff --git a/infra/build/functions/test_data/expected_build_steps_ubuntu_24_04.json b/infra/build/functions/test_data/expected_build_steps_ubuntu_24_04.json new file mode 100644 index 000000000000..ad24129384ad --- /dev/null +++ b/infra/build/functions/test_data/expected_build_steps_ubuntu_24_04.json @@ -0,0 +1,1348 @@ +[ + { + "args": [ + "clone", + "https://github.com/google/oss-fuzz.git", + "--depth", + "1" + ], + "name": "gcr.io/cloud-builders/git" + }, + { + "name": "gcr.io/cloud-builders/docker", + "args": [ + "build", + "--tag", + "gcr.io/oss-fuzz/test-project", + "--tag", + "us-central1-docker.pkg.dev/oss-fuzz/unsafe/test-project", + "oss-fuzz/projects/test-project" + ], + "id": "build-UNIQUE_ID" + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json" + ], + "env": [ + "OSSFUZZ_REVISION=$REVISION_ID", + "FUZZING_LANGUAGE=c++" + ], + "id": "srcmap" + }, + { + "name": "gcr.io/cloud-builders/docker", + "args": [ + "run", + "--privileged", + "linuxkit/binfmt:v0.8" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "args": [ + "buildx", + "create", + "--name", + "buildxbuilder" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "args": [ + "buildx", + "use", + "buildxbuilder" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "args": [ + "buildx", + "build", + "--platform", + "linux/arm64", + "--progress", + "plain", + "--load", + "--tag", + "gcr.io/oss-fuzz/test-project-aarch64", + "--tag", + "us-central1-docker.pkg.dev/oss-fuzz/unsafe/test-project-aarch64", + "oss-fuzz/projects/test-project" + ], + "id": "build-UNIQUE_ID" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=afl", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/afl-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=afl", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/afl-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/afl-address-x86_64 && compile || (echo \"********************************************************************************\\nFailed to build.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine afl --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "compile-afl-address-x86_64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=afl", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/afl-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=afl", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/afl-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\\nBuild checks failed.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine afl --architecture x86_64 test-project\\npython infra/helper.py check_build --sanitizer address --engine afl --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "build-check-afl-address-x86_64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=afl", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/afl-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.address" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/afl-address-x86_64 && zip -r test-project-address-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/afl-address-x86_64/test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.address", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/afl-address-x86_64" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-address-x86_64 && compile || (echo \"********************************************************************************\\nFailed to build.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "compile-centipede-address-x86_64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\\nBuild checks failed.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine centipede --architecture x86_64 test-project\\npython infra/helper.py check_build --sanitizer address --engine centipede --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "build-check-centipede-address-x86_64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.address" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/centipede-address-x86_64 && zip -r test-project-address-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/centipede-address-x86_64/test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.address", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/centipede-address-x86_64" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-none-x86_64", + "SANITIZER=none" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-none-x86_64", + "-e", + "SANITIZER=none", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/centipede-none-x86_64 && compile || (echo \"********************************************************************************\\nFailed to build.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "compile-centipede-none-x86_64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-none-x86_64", + "SANITIZER=none" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=centipede", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/centipede-none-x86_64", + "-e", + "SANITIZER=none", + "-t", + "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\\nBuild checks failed.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer none --engine centipede --architecture x86_64 test-project\\npython infra/helper.py check_build --sanitizer none --engine centipede --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "build-check-centipede-none-x86_64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=centipede", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/centipede-none-x86_64", + "SANITIZER=none" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.none" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/centipede-none-x86_64 && zip -r test-project-none-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/centipede-none-x86_64/test-project-none-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.none", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-none-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/centipede-none-x86_64" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=honggfuzz", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/honggfuzz-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=honggfuzz", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/honggfuzz-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/honggfuzz-address-x86_64 && compile || (echo \"********************************************************************************\\nFailed to build.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine honggfuzz --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "compile-honggfuzz-address-x86_64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=honggfuzz", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/honggfuzz-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=honggfuzz", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/honggfuzz-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\\nBuild checks failed.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine honggfuzz --architecture x86_64 test-project\\npython infra/helper.py check_build --sanitizer address --engine honggfuzz --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "build-check-honggfuzz-address-x86_64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=honggfuzz", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/honggfuzz-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.address" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/honggfuzz-address-x86_64 && zip -r test-project-address-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/honggfuzz-address-x86_64/test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.address", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/honggfuzz-address-x86_64" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=libfuzzer", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/libfuzzer-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-address-x86_64 && compile || (echo \"********************************************************************************\\nFailed to build.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "compile-libfuzzer-address-x86_64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=libfuzzer", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/libfuzzer-address-x86_64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\\nBuild checks failed.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture x86_64 test-project\\npython infra/helper.py check_build --sanitizer address --engine libfuzzer --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "build-check-libfuzzer-address-x86_64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-address-x86_64", + "SANITIZER=address" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.address" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/libfuzzer-address-x86_64 && zip -r test-project-address-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/libfuzzer-address-x86_64/test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.address", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/libfuzzer-address-x86_64" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=i386", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-address-i386", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=i386", + "-e", + "FUZZING_ENGINE=libfuzzer", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/libfuzzer-address-i386", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-address-i386 && compile || (echo \"********************************************************************************\\nFailed to build.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture i386 test-project\\n********************************************************************************\" && false)" + ], + "id": "compile-libfuzzer-address-i386" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=i386", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-address-i386", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=i386", + "-e", + "FUZZING_ENGINE=libfuzzer", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/libfuzzer-address-i386", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\\nBuild checks failed.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture i386 test-project\\npython infra/helper.py check_build --sanitizer address --engine libfuzzer --architecture i386 test-project\\n********************************************************************************\" && false)" + ], + "id": "build-check-libfuzzer-address-i386" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "env": [ + "ARCHITECTURE=i386", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-address-i386", + "SANITIZER=address" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.address" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/libfuzzer-address-i386 && zip -r test-project-address-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/libfuzzer-address-i386/test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.address", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/libfuzzer-address-i386" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=aarch64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-address-aarch64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/arm64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=aarch64", + "-e", + "FUZZING_ENGINE=libfuzzer", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/libfuzzer-address-aarch64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz/test-project-aarch64", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-address-aarch64 && compile || (echo \"********************************************************************************\\nFailed to build.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture aarch64 test-project\\n********************************************************************************\" && false)" + ], + "id": "compile-libfuzzer-address-aarch64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=aarch64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-address-aarch64", + "SANITIZER=address" + ], + "args": [ + "run", + "--platform", + "linux/arm64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=aarch64", + "-e", + "FUZZING_ENGINE=libfuzzer", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/libfuzzer-address-aarch64", + "-e", + "SANITIZER=address", + "-t", + "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\\nBuild checks failed.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture aarch64 test-project\\npython infra/helper.py check_build --sanitizer address --engine libfuzzer --architecture aarch64 test-project\\n********************************************************************************\" && false)" + ], + "id": "build-check-libfuzzer-address-aarch64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "env": [ + "ARCHITECTURE=aarch64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-address-aarch64", + "SANITIZER=address" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.address" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/libfuzzer-address-aarch64 && zip -r test-project-address-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/libfuzzer-address-aarch64/test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.address", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-address-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/libfuzzer-address-aarch64" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-memory-x86_64", + "SANITIZER=memory" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=libfuzzer", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/libfuzzer-memory-x86_64", + "-e", + "SANITIZER=memory", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-memory-x86_64 && compile || (echo \"********************************************************************************\\nFailed to build.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer memory --engine libfuzzer --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "compile-libfuzzer-memory-x86_64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-memory-x86_64", + "SANITIZER=memory" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=libfuzzer", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/libfuzzer-memory-x86_64", + "-e", + "SANITIZER=memory", + "-t", + "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\\nBuild checks failed.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer memory --engine libfuzzer --architecture x86_64 test-project\\npython infra/helper.py check_build --sanitizer memory --engine libfuzzer --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "build-check-libfuzzer-memory-x86_64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-memory-x86_64", + "SANITIZER=memory" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.memory" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/libfuzzer-memory-x86_64 && zip -r test-project-memory-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/libfuzzer-memory-x86_64/test-project-memory-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.memory", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-memory-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/libfuzzer-memory-x86_64" + ] + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-undefined-x86_64", + "SANITIZER=undefined" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=libfuzzer", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/libfuzzer-undefined-x86_64", + "-e", + "SANITIZER=undefined", + "-t", + "gcr.io/oss-fuzz/test-project", + "bash", + "-c", + "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-undefined-x86_64 && compile || (echo \"********************************************************************************\\nFailed to build.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer undefined --engine libfuzzer --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "compile-libfuzzer-undefined-x86_64" + }, + { + "name": "gcr.io/cloud-builders/docker", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-undefined-x86_64", + "SANITIZER=undefined" + ], + "args": [ + "run", + "--platform", + "linux/amd64", + "-v", + "/workspace:/workspace", + "--privileged", + "--cap-add=all", + "-e", + "ARCHITECTURE=x86_64", + "-e", + "FUZZING_ENGINE=libfuzzer", + "-e", + "FUZZING_LANGUAGE=c++", + "-e", + "HOME=/root", + "-e", + "OUT=/workspace/out/libfuzzer-undefined-x86_64", + "-e", + "SANITIZER=undefined", + "-t", + "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "bash", + "-c", + "test_all.py || (echo \"********************************************************************************\\nBuild checks failed.\\nTo reproduce, run:\\npython infra/helper.py build_image test-project\\npython infra/helper.py build_fuzzers --sanitizer undefined --engine libfuzzer --architecture x86_64 test-project\\npython infra/helper.py check_build --sanitizer undefined --engine libfuzzer --architecture x86_64 test-project\\n********************************************************************************\" && false)" + ], + "id": "build-check-libfuzzer-undefined-x86_64" + }, + { + "name": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", + "env": [ + "ARCHITECTURE=x86_64", + "FUZZING_ENGINE=libfuzzer", + "FUZZING_LANGUAGE=c++", + "HOME=/root", + "OUT=/workspace/out/libfuzzer-undefined-x86_64", + "SANITIZER=undefined" + ], + "args": [ + "bash", + "-c", + "targets_list > /workspace/targets.list.undefined" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "cd /workspace/out/libfuzzer-undefined-x86_64 && zip -r test-project-undefined-202001010000.zip *" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/srcmap.json", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/out/libfuzzer-undefined-x86_64/test-project-undefined-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz-base/uploader", + "args": [ + "/workspace/targets.list.undefined", + "test_url" + ] + }, + { + "name": "gcr.io/cloud-builders/curl", + "args": [ + "-H", + "Content-Type: text/plain", + "-X", + "PUT", + "-d", + "test-project-undefined-202001010000.zip", + "test_url" + ] + }, + { + "name": "gcr.io/oss-fuzz/test-project", + "args": [ + "bash", + "-c", + "rm -r /workspace/out/libfuzzer-undefined-x86_64" + ] + } +] \ No newline at end of file