Skip to content

Commit

Permalink
Merge branch 'main' into engine_tests_use_canvaskit
Browse files Browse the repository at this point in the history
  • Loading branch information
mdebbar authored Dec 11, 2024
2 parents f1387d0 + 3cdd841 commit 12f6cb1
Show file tree
Hide file tree
Showing 70 changed files with 1,311 additions and 1,037 deletions.
18 changes: 9 additions & 9 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ vars = {
'flutter_git': 'https://flutter.googlesource.com',
'skia_git': 'https://skia.googlesource.com',
'llvm_git': 'https://llvm.googlesource.com',
'skia_revision': 'e78dd02650024d7f0e4d8cb73e3b6657b19b0317',
'skia_revision': '79a7b95e32fe945a1424e596586d616b39cf023d',

# WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY
# See `lib/web_ui/README.md` for how to roll CanvasKit to a new version.
Expand Down Expand Up @@ -56,21 +56,21 @@ vars = {
# Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS
# You can use //tools/dart/create_updated_flutter_deps.py to produce
# updated revision list of existing dependencies.
'dart_revision': '264c0c6f5894a713c092e3308360242f6721c485',
'dart_revision': 'be9c98daf9dfa5b2a2737370087f67d3ae162355',

# WARNING: DO NOT EDIT MANUALLY
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
'dart_binaryen_rev': '93883fde36ac158fd415dcd6dbd387dcfd928d3c',
'dart_boringssl_rev': '567289e4bb1958153f428bba52d953f3c080b4d7',
'dart_core_rev': 'abcf992cf9fe1e896ed9dcff15523c0a6c00621d',
'dart_boringssl_rev': '57f525e425a95e7c89fa2df926fa93273bd47311',
'dart_core_rev': '7f9f597e64fa52faebd3c0a2214f61a7b081174d',
'dart_devtools_rev': '3e5327a02693b1405359dc5322d7f0a40151b9b7',
'dart_http_rev': '79470d014b467f01b0e7c5b63ab6c86b22dec8db',
'dart_libprotobuf_rev': '24487dd1045c7f3d64a21f38a3f0c06cc4cf2edb',
'dart_perfetto_rev': '13ce0c9e13b0940d2476cd0cff2301708a9a2e2b',
'dart_protobuf_gn_rev': 'ca669f79945418f6229e4fef89b666b2a88cbb10',
'dart_protobuf_rev': 'da7279c56734cffed4deb1e3a6f93bdcefccf6b8',
'dart_pub_rev': '30bfc439fedba1ee3daadcf542f1483479bc4909',
'dart_tools_rev': '1c5b8b949128d62182e162ef65a2e6f3feb19acf',
'dart_tools_rev': '223daf5300a5e3f6e09b7e24a5fda1009d6708f7',
'dart_watcher_rev': 'bc44e6f6b85972e516c44b9ae6c042b4cbd7c72b',
'dart_web_rev': 'bdf112ec64d28285cc29c6c78274ff3a827bb79b',
'dart_webdev_rev': '5f30c560dc4e3df341356c43ec1a766ee6b74a7c',
Expand Down Expand Up @@ -353,7 +353,7 @@ deps = {
Var('dart_git') + '/markdown.git@4d5dbc659955973902f2585c54e94d453532db70',

'src/flutter/third_party/dart/third_party/pkg/native':
Var('dart_git') + '/native.git@028f89d4a59448f9ecda5bd3d4519e2d7c742072',
Var('dart_git') + '/native.git@da5dc148a0430b6c4224b59178db5385d79b2298',

'src/flutter/third_party/dart/third_party/pkg/package_config':
Var('dart_git') + '/package_config.git@76f2f6c245451da1fa24d7bbb00251b909e729a5',
Expand Down Expand Up @@ -398,7 +398,7 @@ deps = {
Var('dart_git') + '/term_glyph.git@9ed8ed96fdd84cb7b72ee1be3e86010969fa95d4',

'src/flutter/third_party/dart/third_party/pkg/test':
Var('dart_git') + '/test.git@20967732ea9dd30240a6429621ab2f82874bd9f0',
Var('dart_git') + '/test.git@dc0f8ea4d09aabb0fed16daea3d4653c8f967b02',

'src/flutter/third_party/dart/third_party/pkg/test_reflective_loader':
Var('dart_git') + '/test_reflective_loader.git@faade6299d1823f0d062eb5e98f3b440ddcea7c6',
Expand Down Expand Up @@ -428,7 +428,7 @@ deps = {
Var('dart_git') + '/yaml_edit.git' + '@' + Var('dart_yaml_edit_rev'),

'src/flutter/third_party/dart/tools/sdks/dart-sdk':
{'dep_type': 'cipd', 'packages': [{'package': 'dart/dart-sdk/${{platform}}', 'version': 'git_revision:7fce3544047c41018b8c00b4453c0262f463dd74'}]},
{'dep_type': 'cipd', 'packages': [{'package': 'dart/dart-sdk/${{platform}}', 'version': 'git_revision:c7e47c6c5df6ffa16d92704d5291b3387f974648'}]},

# WARNING: end of dart dependencies list that is cleaned up automatically - see create_updated_flutter_deps.py.

Expand Down Expand Up @@ -870,7 +870,7 @@ deps = {
'packages': [
{
'package': 'fuchsia/sdk/core/linux-amd64',
'version': 'tVShMDVFeKJFcDFHJ_xBV2Ui9aj9rIfUvNGqu-n-RswC'
'version': 'HJ57Y3zxqDamI8qkY5tkyNUvXEfo3t-v6nnb4Eqp4p4C'
}
],
'condition': 'download_fuchsia_deps and not download_fuchsia_sdk',
Expand Down
146 changes: 143 additions & 3 deletions ci/bin/format.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ enum MessageType {
}

enum FormatCheck {
dart,
gn,
java,
python,
Expand All @@ -53,6 +54,8 @@ FormatCheck nameToFormatCheck(String name) {
switch (name) {
case 'clang':
return FormatCheck.clang;
case 'dart':
return FormatCheck.dart;
case 'gn':
return FormatCheck.gn;
case 'java':
Expand All @@ -72,6 +75,8 @@ String formatCheckToName(FormatCheck check) {
switch (check) {
case FormatCheck.clang:
return 'C++/ObjC/Shader';
case FormatCheck.dart:
return 'Dart';
case FormatCheck.gn:
return 'GN';
case FormatCheck.java:
Expand All @@ -87,8 +92,7 @@ String formatCheckToName(FormatCheck check) {

List<String> formatCheckNames() {
return FormatCheck.values
.map<String>((FormatCheck check) =>
check.toString().replaceFirst('$FormatCheck.', ''))
.map<String>((FormatCheck check) => check.name)
.toList();
}

Expand Down Expand Up @@ -141,6 +145,14 @@ abstract class FormatChecker {
allFiles: allFiles,
messageCallback: messageCallback,
);
case FormatCheck.dart:
return DartFormatChecker(
processManager: processManager,
baseGitRef: baseGitRef,
repoDir: repoDir,
allFiles: allFiles,
messageCallback: messageCallback,
);
case FormatCheck.gn:
return GnFormatChecker(
processManager: processManager,
Expand Down Expand Up @@ -786,6 +798,133 @@ class GnFormatChecker extends FormatChecker {
}
}

/// Checks the format of any .dart files using the "dart format" command.
class DartFormatChecker extends FormatChecker {
DartFormatChecker({
super.processManager,
required super.baseGitRef,
required Directory repoDir,
super.allFiles,
super.messageCallback,
}) : super(
repoDir: repoDir,
) {
// $ENGINE/flutter/third_party/dart/tools/sdks/dart-sdk/bin/dart
_dartBin = path.join(
repoDir.absolute.parent.path,
'flutter',
'third_party',
'dart',
'tools',
'sdks',
'dart-sdk',
'bin',
Platform.isWindows ? 'dart.exe' : 'dart',
);
}

late final String _dartBin;

@override
Future<bool> checkFormatting() async {
message('Checking Dart formatting...');
return (await _runDartFormat(fixing: false)) == 0;
}

@override
Future<bool> fixFormatting() async {
message('Fixing Dart formatting...');
await _runDartFormat(fixing: true);
// The dart formatter shouldn't fail when fixing errors.
return true;
}

Future<int> _runDartFormat({required bool fixing}) async {
final List<String> filesToCheck = await getFileList(<String>['*.dart']);

final List<String> cmd = <String>[
_dartBin,
'format',
'--set-exit-if-changed',
'--show=none',
if (!fixing) '--output=show',
if (fixing) '--output=write',
];
final List<WorkerJob> jobs = <WorkerJob>[];
for (final String file in filesToCheck) {
jobs.add(WorkerJob(<String>[...cmd, file]));
}
final ProcessPool dartFmt = ProcessPool(
processRunner: _processRunner,
printReport: namedReport('dart format'),
);

Iterable<WorkerJob> incorrect;
if (!fixing) {
final Stream<WorkerJob> completedJobs = dartFmt.startWorkers(jobs);
final List<WorkerJob> diffJobs = <WorkerJob>[];
await for (final WorkerJob completedJob in completedJobs) {
if (completedJob.result.exitCode == 1) {
diffJobs.add(
WorkerJob(
<String>[
'git',
'diff',
'--no-index',
'--no-color',
'--ignore-cr-at-eol',
'--',
completedJob.command.last,
'-',
],
stdinRaw: codeUnitsAsStream(completedJob.result.stdoutRaw),
),
);
}
}
final ProcessPool diffPool = ProcessPool(
processRunner: _processRunner,
printReport: namedReport('diff'),
);
final List<WorkerJob> completedDiffs = await diffPool.runToCompletion(diffJobs);
incorrect = completedDiffs.where((WorkerJob job) {
return job.result.exitCode != 0;
});
} else {
final List<WorkerJob> completedJobs = await dartFmt.runToCompletion(jobs);
incorrect = completedJobs.where((WorkerJob job) => job.result.exitCode == 1);
}

reportDone();

if (incorrect.isNotEmpty) {
final bool plural = incorrect.length > 1;
if (fixing) {
message('Fixing ${incorrect.length} dart file${plural ? 's' : ''}'
' which ${plural ? 'were' : 'was'} formatted incorrectly.');
} else {
error('Found ${incorrect.length} Dart file${plural ? 's' : ''}'
' which ${plural ? 'were' : 'was'} formatted incorrectly.');
stdout.writeln('To fix, run `et format` or:');
stdout.writeln();
stdout.writeln('git apply <<DONE');
for (final WorkerJob job in incorrect) {
stdout.write(job.result.stdout
.replaceFirst('b/-', 'b/${job.command[job.command.length - 2]}')
.replaceFirst('b/-', 'b/${job.command[job.command.length - 2]}')
.replaceFirst(RegExp('\\+Formatted \\d+ files? \\(\\d+ changed\\) in \\d+.\\d+ seconds.\n'), '')
);
}
stdout.writeln('DONE');
stdout.writeln();
}
} else {
message('All dart files formatted correctly.');
}
return incorrect.length;
}
}

/// Checks the format of any .py files using the "yapf" command.
class PythonFormatChecker extends FormatChecker {
PythonFormatChecker({
Expand Down Expand Up @@ -1144,7 +1283,8 @@ Future<int> main(List<String> arguments) async {
parser.addMultiOption('check',
abbr: 'c',
allowed: formatCheckNames(),
defaultsTo: formatCheckNames(),
// TODO(goderbauer): Enable dart by default when we turned on the formatter.
defaultsTo: formatCheckNames()..remove(FormatCheck.dart.name),
help: 'Specifies which checks will be performed. Defaults to all checks. '
'May be specified more than once to perform multiple types of checks. ');
parser.addFlag('verbose', help: 'Print verbose output.', defaultsTo: verbose);
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function verify_licenses() (

local actualLicenseCount
actualLicenseCount="$(tail -n 1 flutter/ci/licenses_golden/licenses_flutter | tr -dc '0-9')"
local expectedLicenseCount=919
local expectedLicenseCount=918

if [[ $actualLicenseCount -ne $expectedLicenseCount ]]; then
echo "=============================== ERROR ==============================="
Expand Down
4 changes: 2 additions & 2 deletions ci/licenses_golden/excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
../../../flutter/impeller/golden_tests/README.md
../../../flutter/impeller/playground
../../../flutter/impeller/renderer/backend/gles/buffer_bindings_gles_unittests.cc
../../../flutter/impeller/renderer/backend/gles/device_buffer_gles_unittests.cc
../../../flutter/impeller/renderer/backend/gles/test
../../../flutter/impeller/renderer/backend/gles/unique_handle_gles_unittests.cc
../../../flutter/impeller/renderer/backend/metal/allocator_mtl_unittests.mm
Expand Down Expand Up @@ -990,7 +991,6 @@
../../../flutter/third_party/boringssl/src/crypto/curve25519/x25519_test.cc
../../../flutter/third_party/boringssl/src/crypto/dh_extra/dh_test.cc
../../../flutter/third_party/boringssl/src/crypto/digest_extra/digest_test.cc
../../../flutter/third_party/boringssl/src/crypto/dilithium/dilithium_test.cc
../../../flutter/third_party/boringssl/src/crypto/dsa/dsa_test.cc
../../../flutter/third_party/boringssl/src/crypto/ecdh_extra/ecdh_test.cc
../../../flutter/third_party/boringssl/src/crypto/err/err_test.cc
Expand Down Expand Up @@ -1049,7 +1049,6 @@
../../../flutter/third_party/boringssl/src/crypto/self_test.cc
../../../flutter/third_party/boringssl/src/crypto/siphash/siphash_test.cc
../../../flutter/third_party/boringssl/src/crypto/slhdsa/slhdsa_test.cc
../../../flutter/third_party/boringssl/src/crypto/spx/spx_test.cc
../../../flutter/third_party/boringssl/src/crypto/stack/stack_test.cc
../../../flutter/third_party/boringssl/src/crypto/test
../../../flutter/third_party/boringssl/src/crypto/thread_test.cc
Expand Down Expand Up @@ -2805,6 +2804,7 @@
../../../flutter/third_party/skia/modules/canvaskit/wasm_tools/SIMD/.gitignore
../../../flutter/third_party/skia/modules/jetski/BUILD.bazel
../../../flutter/third_party/skia/modules/jetski/README
../../../flutter/third_party/skia/modules/jsonreader/BUILD.bazel
../../../flutter/third_party/skia/modules/pathkit/.gitignore
../../../flutter/third_party/skia/modules/pathkit/BUILD.bazel
../../../flutter/third_party/skia/modules/pathkit/CHANGELOG.md
Expand Down
4 changes: 2 additions & 2 deletions ci/licenses_golden/licenses_dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: 42c0a1e0c2d00da991b25de9e0e74029
Signature: e09a316ed3e27737f6fc5413c2b96f7c

====================================================================================================
LIBRARY: dart
Expand Down Expand Up @@ -4807,7 +4807,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/838ed940b056e9010de4d5fcedfcf8c245848f22
You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/be9c98daf9dfa5b2a2737370087f67d3ae162355
/third_party/fallback_root_certificates/

====================================================================================================
Expand Down
Loading

0 comments on commit 12f6cb1

Please sign in to comment.