Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d3e2dc2

Browse files
authored
Merge branch 'main' into 1-multi-win-foundation
2 parents 8739d84 + 66832de commit d3e2dc2

File tree

392 files changed

+9800
-7766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

392 files changed

+9800
-7766
lines changed

.ci.yaml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -416,36 +416,6 @@ targets:
416416
properties:
417417
config_name: linux_unopt
418418

419-
- name: Linux Web Framework tests
420-
recipe: engine/web_engine_framework
421-
enabled_branches:
422-
- main
423-
properties:
424-
add_recipes_cq: "true"
425-
cores: "32"
426-
gclient_variables: >-
427-
{"download_emsdk": true}
428-
dependencies: >-
429-
[
430-
{"dependency": "chrome_and_driver", "version": "version:119.0.6045.9"},
431-
{"dependency": "curl", "version": "version:7.64.0"}
432-
]
433-
no_goma: "true"
434-
drone_dimensions: >
435-
["device_type=none", "os=Linux"]
436-
shard: web_tests
437-
subshards: >-
438-
["0", "1", "2", "3", "4", "5", "6", "7_last"]
439-
timeout: 120
440-
runIf:
441-
- DEPS
442-
- .ci.yaml
443-
- lib/web_ui/**
444-
- web_sdk/**
445-
- tools/**
446-
- ci/**
447-
- flutter_frontend_server/**
448-
449419
- name: Linux mac_android_aot_engine
450420
recipe: engine_v2/engine_v2
451421
timeout: 240

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Checks: >-
1717
-google-default-arguments,
1818
-google-objc-global-variable-declaration,
1919
-google-objc-avoid-throwing-exception,
20-
-google-readability-casting,
2120
-clang-analyzer-nullability.NullPassedToNonnull,
2221
-clang-analyzer-nullability.NullablePassedToNonnull,
2322
-clang-analyzer-nullability.NullReturnedFromNonnull,

.github/workflows/third_party_scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
name: Vulnerability scanning
4242
needs:
4343
extract-deps
44-
uses: "google/osv-scanner-action/.github/workflows/[email protected].0"
44+
uses: "google/osv-scanner-action/.github/workflows/[email protected].2"
4545
with:
4646
# Download the artifact uploaded in extract-deps step
4747
download-artifact: osv-lockfile-${{github.sha}}

DEPS

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ vars = {
1414
'flutter_git': 'https://flutter.googlesource.com',
1515
'skia_git': 'https://skia.googlesource.com',
1616
'llvm_git': 'https://llvm.googlesource.com',
17-
'skia_revision': 'bd7d952398d511dbba69346c912eccd445126d5d',
17+
'skia_revision': 'f784f78a5669962a23243ff67997239a64ce8c99',
1818

1919
# WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY
2020
# See `lib/web_ui/README.md` for how to roll CanvasKit to a new version.
@@ -56,24 +56,24 @@ vars = {
5656
# Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS
5757
# You can use //tools/dart/create_updated_flutter_deps.py to produce
5858
# updated revision list of existing dependencies.
59-
'dart_revision': '1a28e6c86b09f1c83365f54388c32ed97c9e9b31',
59+
'dart_revision': '37bbc285d8d2ad66843703d7f60dcdf23fd76175',
6060

6161
# WARNING: DO NOT EDIT MANUALLY
6262
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
63-
'dart_binaryen_rev': '93883fde36ac158fd415dcd6dbd387dcfd928d3c',
64-
'dart_boringssl_rev': 'bb13a96931dd90d6570fa6151e19ef426d5c641f',
63+
'dart_binaryen_rev': '87f9dac127b387715d8d96ac7ec8fd469d8c2dab',
64+
'dart_boringssl_rev': '57f525e425a95e7c89fa2df926fa93273bd47311',
6565
'dart_core_rev': '7f9f597e64fa52faebd3c0a2214f61a7b081174d',
6666
'dart_devtools_rev': '3e5327a02693b1405359dc5322d7f0a40151b9b7',
6767
'dart_http_rev': '79470d014b467f01b0e7c5b63ab6c86b22dec8db',
6868
'dart_libprotobuf_rev': '24487dd1045c7f3d64a21f38a3f0c06cc4cf2edb',
6969
'dart_perfetto_rev': '13ce0c9e13b0940d2476cd0cff2301708a9a2e2b',
7070
'dart_protobuf_gn_rev': 'ca669f79945418f6229e4fef89b666b2a88cbb10',
7171
'dart_protobuf_rev': 'da7279c56734cffed4deb1e3a6f93bdcefccf6b8',
72-
'dart_pub_rev': '30bfc439fedba1ee3daadcf542f1483479bc4909',
72+
'dart_pub_rev': '58de642dc1d07601f6eb2b4ecd94555c0210106b',
7373
'dart_tools_rev': '223daf5300a5e3f6e09b7e24a5fda1009d6708f7',
7474
'dart_watcher_rev': 'bc44e6f6b85972e516c44b9ae6c042b4cbd7c72b',
7575
'dart_web_rev': 'bdf112ec64d28285cc29c6c78274ff3a827bb79b',
76-
'dart_webdev_rev': '5f30c560dc4e3df341356c43ec1a766ee6b74a7c',
76+
'dart_webdev_rev': 'ab620d1a81adc57b5045a189e076b9930ae66208',
7777
'dart_webkit_inspection_protocol_rev': 'effa75205516757795683d527c3dea9546eb0c32',
7878
'dart_yaml_edit_rev': 'fbdc70acc164af187772e013a2e1364cd05b88dc',
7979

@@ -320,7 +320,7 @@ deps = {
320320
# WARNING: Unused Dart dependencies in the list below till "WARNING:" marker are removed automatically - see create_updated_flutter_deps.py.
321321

322322
'src/flutter/third_party/dart/third_party/binaryen/src':
323-
Var('chromium_git') + '/external/github.com/WebAssembly/binaryen.git@93883fde36ac158fd415dcd6dbd387dcfd928d3c',
323+
Var('chromium_git') + '/external/github.com/WebAssembly/binaryen.git@87f9dac127b387715d8d96ac7ec8fd469d8c2dab',
324324

325325
'src/flutter/third_party/dart/third_party/devtools':
326326
{'dep_type': 'cipd', 'packages': [{'package': 'dart/third_party/flutter/devtools', 'version': 'git_revision:3e5327a02693b1405359dc5322d7f0a40151b9b7'}]},
@@ -353,7 +353,7 @@ deps = {
353353
Var('dart_git') + '/markdown.git@4d5dbc659955973902f2585c54e94d453532db70',
354354

355355
'src/flutter/third_party/dart/third_party/pkg/native':
356-
Var('dart_git') + '/native.git@8ea1a9db0af42933eb22334c4506ca464d7237e9',
356+
Var('dart_git') + '/native.git@da5dc148a0430b6c4224b59178db5385d79b2298',
357357

358358
'src/flutter/third_party/dart/third_party/pkg/package_config':
359359
Var('dart_git') + '/package_config.git@76f2f6c245451da1fa24d7bbb00251b909e729a5',
@@ -428,7 +428,7 @@ deps = {
428428
Var('dart_git') + '/yaml_edit.git' + '@' + Var('dart_yaml_edit_rev'),
429429

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

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

@@ -870,7 +870,7 @@ deps = {
870870
'packages': [
871871
{
872872
'package': 'fuchsia/sdk/core/linux-amd64',
873-
'version': '5taAI9-tnFN84ZJvrs2E-sXIhxas7Bw7jxCrLtzcnaEC'
873+
'version': 'zvsXvTuk-Z1Mgtn34lhXHPbQAAPOVrHYuEZZJqa6N9oC'
874874
}
875875
],
876876
'condition': 'download_fuchsia_deps and not download_fuchsia_sdk',

ci/bin/format.dart

Lines changed: 167 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ enum MessageType {
4040
}
4141

4242
enum FormatCheck {
43+
dart,
4344
gn,
4445
java,
4546
python,
@@ -53,6 +54,8 @@ FormatCheck nameToFormatCheck(String name) {
5354
switch (name) {
5455
case 'clang':
5556
return FormatCheck.clang;
57+
case 'dart':
58+
return FormatCheck.dart;
5659
case 'gn':
5760
return FormatCheck.gn;
5861
case 'java':
@@ -72,6 +75,8 @@ String formatCheckToName(FormatCheck check) {
7275
switch (check) {
7376
case FormatCheck.clang:
7477
return 'C++/ObjC/Shader';
78+
case FormatCheck.dart:
79+
return 'Dart';
7580
case FormatCheck.gn:
7681
return 'GN';
7782
case FormatCheck.java:
@@ -87,8 +92,7 @@ String formatCheckToName(FormatCheck check) {
8792

8893
List<String> formatCheckNames() {
8994
return FormatCheck.values
90-
.map<String>((FormatCheck check) =>
91-
check.toString().replaceFirst('$FormatCheck.', ''))
95+
.map<String>((FormatCheck check) => check.name)
9296
.toList();
9397
}
9498

@@ -141,6 +145,14 @@ abstract class FormatChecker {
141145
allFiles: allFiles,
142146
messageCallback: messageCallback,
143147
);
148+
case FormatCheck.dart:
149+
return DartFormatChecker(
150+
processManager: processManager,
151+
baseGitRef: baseGitRef,
152+
repoDir: repoDir,
153+
allFiles: allFiles,
154+
messageCallback: messageCallback,
155+
);
144156
case FormatCheck.gn:
145157
return GnFormatChecker(
146158
processManager: processManager,
@@ -786,6 +798,157 @@ class GnFormatChecker extends FormatChecker {
786798
}
787799
}
788800

801+
/// Checks the format of any .dart files using the "dart format" command.
802+
class DartFormatChecker extends FormatChecker {
803+
DartFormatChecker({
804+
super.processManager,
805+
required super.baseGitRef,
806+
required Directory repoDir,
807+
super.allFiles,
808+
super.messageCallback,
809+
}) : super(
810+
repoDir: repoDir,
811+
) {
812+
// $ENGINE/flutter/third_party/dart/tools/sdks/dart-sdk/bin/dart
813+
_dartBin = path.join(
814+
repoDir.absolute.parent.path,
815+
'flutter',
816+
'third_party',
817+
'dart',
818+
'tools',
819+
'sdks',
820+
'dart-sdk',
821+
'bin',
822+
Platform.isWindows ? 'dart.exe' : 'dart',
823+
);
824+
}
825+
826+
late final String _dartBin;
827+
828+
@override
829+
Future<bool> checkFormatting() async {
830+
message('Checking Dart formatting...');
831+
return (await _runDartFormat(fixing: false)) == 0;
832+
}
833+
834+
@override
835+
Future<bool> fixFormatting() async {
836+
message('Fixing Dart formatting...');
837+
return (await _runDartFormat(fixing: true)) == 0;
838+
}
839+
840+
Future<int> _runDartFormat({required bool fixing}) async {
841+
final List<String> filesToCheck = await getFileList(<String>['*.dart']);
842+
843+
final List<String> cmd = <String>[
844+
_dartBin,
845+
'format',
846+
'--set-exit-if-changed',
847+
'--show=none',
848+
if (!fixing) '--output=show',
849+
if (fixing) '--output=write',
850+
];
851+
final List<WorkerJob> jobs = <WorkerJob>[];
852+
for (final String file in filesToCheck) {
853+
jobs.add(WorkerJob(<String>[...cmd, file]));
854+
}
855+
final ProcessPool dartFmt = ProcessPool(
856+
processRunner: _processRunner,
857+
printReport: namedReport('dart format'),
858+
);
859+
860+
Iterable<WorkerJob> incorrect;
861+
final List<WorkerJob> errorJobs = [];
862+
if (!fixing) {
863+
final Stream<WorkerJob> completedJobs = dartFmt.startWorkers(jobs);
864+
final List<WorkerJob> diffJobs = <WorkerJob>[];
865+
await for (final WorkerJob completedJob in completedJobs) {
866+
if (completedJob.result.exitCode != 0 && completedJob.result.exitCode != 1) {
867+
// The formatter had a problem formatting the file.
868+
errorJobs.add(completedJob);
869+
} else if (completedJob.result.exitCode == 1) {
870+
diffJobs.add(
871+
WorkerJob(<String>[
872+
'git',
873+
'diff',
874+
'--no-index',
875+
'--no-color',
876+
'--ignore-cr-at-eol',
877+
'--',
878+
completedJob.command.last,
879+
'-',
880+
], stdinRaw: codeUnitsAsStream(completedJob.result.stdoutRaw)),
881+
);
882+
}
883+
}
884+
final ProcessPool diffPool = ProcessPool(
885+
processRunner: _processRunner,
886+
printReport: namedReport('diff'),
887+
);
888+
final List<WorkerJob> completedDiffs = await diffPool.runToCompletion(diffJobs);
889+
incorrect = completedDiffs.where((WorkerJob job) {
890+
return job.result.exitCode != 0;
891+
});
892+
} else {
893+
final List<WorkerJob> completedJobs = await dartFmt.runToCompletion(jobs);
894+
final List<WorkerJob> incorrectJobs = incorrect = [];
895+
for (final WorkerJob job in completedJobs) {
896+
if (job.result.exitCode != 0 && job.result.exitCode != 1) {
897+
// The formatter had a problem formatting the file.
898+
errorJobs.add(job);
899+
} else if (job.result.exitCode == 1) {
900+
incorrectJobs.add(job);
901+
}
902+
}
903+
}
904+
905+
reportDone();
906+
907+
if (incorrect.isNotEmpty) {
908+
final bool plural = incorrect.length > 1;
909+
if (fixing) {
910+
message('Fixing ${incorrect.length} dart file${plural ? 's' : ''}'
911+
' which ${plural ? 'were' : 'was'} formatted incorrectly.');
912+
} else {
913+
error('Found ${incorrect.length} Dart file${plural ? 's' : ''}'
914+
' which ${plural ? 'were' : 'was'} formatted incorrectly.');
915+
stdout.writeln();
916+
stdout.writeln('To fix, run `et format` or:');
917+
stdout.writeln();
918+
stdout.writeln('git apply <<DONE');
919+
for (final WorkerJob job in incorrect) {
920+
stdout.write(job.result.stdout
921+
.replaceFirst('b/-', 'b/${job.command[job.command.length - 2]}')
922+
.replaceFirst('b/-', 'b/${job.command[job.command.length - 2]}')
923+
.replaceFirst(RegExp('\\+Formatted \\d+ files? \\(\\d+ changed\\) in \\d+.\\d+ seconds.\n'), '')
924+
);
925+
}
926+
stdout.writeln('DONE');
927+
stdout.writeln();
928+
}
929+
_printErrorJobs(errorJobs);
930+
} else if (errorJobs.isNotEmpty) {
931+
_printErrorJobs(errorJobs);
932+
} else {
933+
message('All dart files formatted correctly.');
934+
}
935+
return fixing ? errorJobs.length : (incorrect.length + errorJobs.length);
936+
}
937+
938+
void _printErrorJobs(List<WorkerJob> errorJobs) {
939+
if (errorJobs.isNotEmpty) {
940+
final bool plural = errorJobs.length > 1;
941+
error('The formatter failed to run on ${errorJobs.length} Dart file${plural ? 's' : ''}.');
942+
stdout.writeln();
943+
for (final WorkerJob job in errorJobs) {
944+
stdout.writeln('--> ${job.command.last} produced the following error:');
945+
stdout.write(job.result.stderr);
946+
stdout.writeln();
947+
}
948+
}
949+
}
950+
}
951+
789952
/// Checks the format of any .py files using the "yapf" command.
790953
class PythonFormatChecker extends FormatChecker {
791954
PythonFormatChecker({
@@ -1144,7 +1307,8 @@ Future<int> main(List<String> arguments) async {
11441307
parser.addMultiOption('check',
11451308
abbr: 'c',
11461309
allowed: formatCheckNames(),
1147-
defaultsTo: formatCheckNames(),
1310+
// TODO(goderbauer): Enable dart by default when we turned on the formatter.
1311+
defaultsTo: formatCheckNames()..remove(FormatCheck.dart.name),
11481312
help: 'Specifies which checks will be performed. Defaults to all checks. '
11491313
'May be specified more than once to perform multiple types of checks. ');
11501314
parser.addFlag('verbose', help: 'Print verbose output.', defaultsTo: verbose);

0 commit comments

Comments
 (0)