Relax project language requirement. (#3846)

This is necessary for the bisector to be able to build older revisions.

Print a warning instead.
This commit is contained in:
Oliver Chang 2020-05-20 08:17:24 +10:00 committed by GitHub
parent 703b92adea
commit e8ef609568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -297,7 +297,7 @@ def _get_project_language(project_name):
if match:
return match.group(1)
raise Exception('language attribute not found in project.yaml.')
return None
def _add_architecture_args(parser, choices=('x86_64', 'i386')):
@ -465,7 +465,7 @@ def build_image(args):
return 1
def build_fuzzers_impl( # pylint: disable=too-many-arguments,too-many-locals
def build_fuzzers_impl( # pylint: disable=too-many-arguments,too-many-locals,too-many-branches
project_name,
clean,
engine,
@ -482,6 +482,8 @@ def build_fuzzers_impl( # pylint: disable=too-many-arguments,too-many-locals
project_out_dir = _get_output_dir(project_name)
project_work_dir = _get_work_dir(project_name)
project_language = _get_project_language(project_name)
if not project_language:
print('WARNING: language not specified in project.yaml. Build may fail.')
if clean:
print('Cleaning existing build artifacts.')
@ -503,10 +505,13 @@ def build_fuzzers_impl( # pylint: disable=too-many-arguments,too-many-locals
print('Keeping existing build artifacts as-is (if any).')
env = [
'FUZZING_ENGINE=' + engine,
'FUZZING_LANGUAGE=' + project_language,
'SANITIZER=' + sanitizer,
'ARCHITECTURE=' + architecture,
]
if project_language:
env.append('FUZZING_LANGUAGE=' + project_language)
if env_to_add:
env += env_to_add