diff --git a/tools/dart/dart_autoroller.py b/tools/dart/dart_autoroller.py index ee17c6ede6d..0f460879bd8 100644 --- a/tools/dart/dart_autoroller.py +++ b/tools/dart/dart_autoroller.py @@ -352,7 +352,7 @@ def main(): most_recent_commit = args.dart_sdk_revision else: # Get the most recent commit that is a reasonable candidate. - most_recent_commit = get_most_recent_green_build(success_threshold=0.9) + most_recent_commit = get_most_recent_green_build(success_threshold=1.0) if args.skip_tests: dart_roll_helper_args.append('--no-test') if args.skip_build: diff --git a/tools/dart/dart_buildbot_helper.py b/tools/dart/dart_buildbot_helper.py index 36587080135..5099fb5e689 100644 --- a/tools/dart/dart_buildbot_helper.py +++ b/tools/dart/dart_buildbot_helper.py @@ -48,6 +48,8 @@ class BuildStatus: return True except KeyError: return False + except TypeError: + return False def is_completed(self): @@ -159,7 +161,7 @@ def get_most_recent_green_build(success_threshold=0.95): # Ignore revisions that returned bad state. This could be due to the bots # being purple or some other infrastructure issues. - valid_states = bool(reduce(lambda x, prev: x.is_valid_status() and prev, commit_states)) + valid_states = bool(reduce(lambda x, y: x and y.is_valid_status(), commit_states)) if not valid_states: continue diff --git a/tools/dart/dart_roll_helper.py b/tools/dart/dart_roll_helper.py index 91d80fe15e8..11592b3aec3 100644 --- a/tools/dart/dart_roll_helper.py +++ b/tools/dart/dart_roll_helper.py @@ -198,12 +198,25 @@ def update_licenses(): print_error('Unknown license script error: {}. Aborting roll.' .format(result)) sys.exit(ERROR_LICENSE_SCRIPT_FAILED) + # Ignore 'licenses_skia' as they shouldn't change during a Dart SDK roll. src_files = ['licenses_flutter', 'licenses_third_party', 'tool_signature'] for f in src_files: path = os.path.join(license_script_output_path(), f) if os.path.isfile(path): shutil.copy(path, engine_golden_licenses_path()) + p = subprocess.Popen(['pub', 'get'], cwd=engine_license_script_package_path()) + p.wait() + gclient_sync() + + # Update the LICENSE file. + with open(sky_license_file_path(), 'w') as sky_license: + p = subprocess.Popen(['dart', os.path.join('lib', 'main.dart'), + '--release', '--src', ENGINE_HOME, + '--out', engine_license_script_output_path()], + cwd=engine_license_script_package_path(), + stdout=sky_license) + p.wait() def get_commit_range(start, finish): diff --git a/tools/dart/dart_roll_utils.py b/tools/dart/dart_roll_utils.py index 7e72d6abd8f..31c79ccd767 100644 --- a/tools/dart/dart_roll_utils.py +++ b/tools/dart/dart_roll_utils.py @@ -66,6 +66,18 @@ def engine_license_script_path(): return os.path.join(ENGINE_HOME, 'flutter', 'ci', 'licenses.sh') +def engine_license_script_dart_path(): + return os.path.join(engine_license_script_package_path(), 'lib', 'main.dart') + + +def engine_license_script_package_path(): + return os.path.join(ENGINE_HOME, 'flutter', 'tools', 'licenses') + + +def engine_license_script_output_path(): + return os.path.join(ENGINE_HOME, 'out', 'licenses') + + def engine_flutter_path(): return os.path.join(ENGINE_HOME, 'flutter') @@ -86,6 +98,10 @@ def package_flutter_path(): return os.path.join(FLUTTER_HOME, 'packages', 'flutter') +def sky_license_file_path(): + return os.path.join(ENGINE_HOME, 'flutter', 'sky', 'packages', 'sky_engine', 'LICENSE') + + def update_dart_deps_path(): return os.path.join(ENGINE_HOME, 'tools', 'dart', 'create_updated_flutter_deps.py')