[CIFuzz] Make it possible to skip bad build check. (#5475)

This will mainly be useful for non-OSS-Fuzz users.
Though it can also be used by OSS-Fuzz users to speed things
up (very slightly in most cases).
Fixes #4377
This commit is contained in:
jonathanmetzman 2021-03-23 09:22:53 -07:00 committed by GitHub
parent 6de9a3b187
commit 00ad715801
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -24,6 +24,10 @@ inputs:
build-integration-path:
description: "The path to the the project's build integration."
required: false
bad-build-check:
description: "Whether or not OSS-Fuzz's check for bad builds should be done."
required: false
default: true
runs:
using: 'docker'
image: '../../../build_fuzzers.Dockerfile'
@ -36,3 +40,4 @@ runs:
PROJECT_SRC_PATH: ${{ inputs.project-src-path }}
BUILD_INTEGRATION_PATH: ${{ inputs.build-integration-path }}
LOW_DISK_SPACE: 'True'
BAD_BUILD_CHECK: ${{ inputs.bad-build-check }}

View File

@ -72,8 +72,13 @@ def main():
return returncode
out_dir = os.path.join(config.workspace, 'out')
if not config.bad_build_check:
# If we've gotten to this point and we don't need to do bad_build_check,
# then the build has succeeded.
returncode = 0
# yapf: disable
if build_fuzzers.check_fuzzer_build(
elif build_fuzzers.check_fuzzer_build(
out_dir,
config.sanitizer,
config.language,

View File

@ -172,6 +172,7 @@ class BuildFuzzersConfig(BaseConfig):
self.allowed_broken_targets_percentage = os.getenv(
'ALLOWED_BROKEN_TARGETS_PERCENTAGE')
self.bad_build_check = environment.get_bool('BAD_BUILD_CHECK', 'true')
# TODO(metzman): Use better system for interpreting env vars. What if env
# var is set to '0'?