Skip to content

Commit 5563d95

Browse files
authored
Roll Dart SDK to 8b036b3e63cbfb6866975f98548051f4dc156ab6. (#6)
Also includes: Call dart::bin::Platform::Initialize during Dart VM startup (flutter/flutter#182689)
1 parent 3997067 commit 5563d95

8 files changed

Lines changed: 81 additions & 56 deletions

File tree

DEPS

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,27 @@ vars = {
4646
# updated revision list of existing dependencies. You will need to
4747
# gclient sync before and after update deps to ensure all deps are updated.
4848
# updated revision list of existing dependencies.
49-
'dart_revision': 'b4a40b86a4f9f3f0ba82941d28839245fab0273e',
49+
'dart_revision': '8b036b3e63cbfb6866975f98548051f4dc156ab6',
5050

5151
# WARNING: DO NOT EDIT MANUALLY
5252
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
53-
'dart_ai_rev': '25a627892f5f398dabf78b91d20ac151f7be2b05',
54-
'dart_binaryen_rev': 'cf2ab2c8b36ded5e3ba5fff03e41c25c20c582f2',
55-
'dart_boringssl_rev': '94e35034946ba05eee2a5f9ca88c18628a615d8d',
56-
'dart_core_rev': 'cbb485437c61d37753bcc98818beca54d5b38f69',
57-
'dart_devtools_rev': 'b9d7fc1a4119b3d214a77939f9d75b0c0b25d36a',
58-
'dart_ecosystem_rev': 'eac66d93142907b39f2271647c111f36ff3365b9',
59-
'dart_http_rev': 'a22386e9c390290c916d1c53a3d3c1447ec120ce',
60-
'dart_i18n_rev': 'dd8a792a8492370a594706c8304d2eb8db844d7a',
61-
'dart_libprotobuf_rev': '24487dd1045c7f3d64a21f38a3f0c06cc4cf2edb',
53+
'dart_ai_rev': 'fd7ce1e5b27a85a73af175d85d72f670bc453bac',
54+
'dart_binaryen_rev': '204c3f88bb2e2c92b103b0cfbf4e0a4863c12c87',
55+
'dart_boringssl_rev': '9a74210911fd45b13274f4b9784c4c6a9c6de0f0',
56+
'dart_core_rev': '5782e0c7d79146e75b170829edb38afd4d69edc5',
57+
'dart_devtools_rev': '0a0cf24dcd589e9436e266d09b6ababa09b8c70e',
58+
'dart_ecosystem_rev': '7bfb1cb1a34794f21b68f80ba1dcc0f3ce701a63',
59+
'dart_http_rev': '30013eb7bc9d7023c39efc18738cd46e00f47dc6',
60+
'dart_i18n_rev': 'de7e11b7cc231d8daf6e49dc12690d7339241691',
6261
'dart_perfetto_rev': '13ce0c9e13b0940d2476cd0cff2301708a9a2e2b',
63-
'dart_protobuf_gn_rev': 'ca669f79945418f6229e4fef89b666b2a88cbb10',
64-
'dart_protobuf_rev': '9e30258e0aa6a6430ee36c84b75308a9702fde42',
65-
'dart_pub_rev': 'ed2628f65de5d54922e2d34ebbcb1bafa8c93cc2',
62+
'dart_protobuf_rev': 'd5639f45b8468fba684b076b9403ccd5f2290056',
63+
'dart_pub_rev': '26c6985c742593d081f8b58450f463a584a4203a',
6664
'dart_sync_http_rev': '6666fff944221891182e1f80bf56569338164d72',
67-
'dart_tools_rev': '93bf967097d251a4d43d4ae65ea047fe3e7f7fa7',
68-
'dart_vector_math_rev': '70a9a2cb610d040b247f3ca2cd70a94c1c6f6f23',
69-
'dart_web_rev': '35fc98dd8f9da175ed0a2dcf246299e922e1e1e2',
65+
'dart_tools_rev': 'fe7cd20a6cf7d9e91b174d1ba5941ef70bcd4cc4',
66+
'dart_vector_math_rev': '66d590b3cbb73397ed1b8aa87b55b2251c536008',
67+
'dart_web_rev': '94d22feda246280b39661f3b74c0ea48a25dd3e7',
7068
'dart_webdev_rev': '234e44c2ba0aa6cee5a36026538ca89457bf0d55',
71-
'dart_webdriver_rev': '09104f459ed834d48b132f6b7734923b1fbcf2e9',
69+
'dart_webdriver_rev': '9b6e829cfe4e6ca0cff7910e2ec58ed809dbc303',
7270
'dart_webkit_inspection_protocol_rev': '0f7685804d77ec02c6564d7ac1a6c8a2341c5bdf',
7371

7472
'ocmock_rev': 'c4ec0e3a7a9f56cfdbd0aa01f4f97bb4b75c5ef8', # v3.7.1
@@ -242,14 +240,6 @@ deps = {
242240
'engine/src/flutter/third_party/boringssl/src':
243241
'https://boringssl.googlesource.com/boringssl.git' + '@' + Var('dart_boringssl_rev'),
244242

245-
'engine/src/flutter/third_party/protobuf':
246-
Var('flutter_git') + '/third_party/protobuf' + '@' + Var('dart_libprotobuf_rev'),
247-
248-
# TODO(67373): These are temporarily checked in, but this dep can be restored
249-
# once the buildmoot is completed.
250-
# 'engine/src/flutter/build/secondary/third_party/protobuf':
251-
# Var('flutter_git') + '/third_party/protobuf-gn' + '@' + Var('dart_protobuf_gn_rev'),
252-
253243
'engine/src/flutter/third_party/dart':
254244
Var('dart_git') + '/sdk.git' + '@' + Var('dart_revision'),
255245

@@ -259,10 +249,10 @@ deps = {
259249
Var('chromium_git') + '/external/github.com/WebAssembly/binaryen.git' + '@' + Var('dart_binaryen_rev'),
260250

261251
'engine/src/flutter/third_party/dart/third_party/devtools':
262-
{'dep_type': 'cipd', 'packages': [{'package': 'dart/third_party/flutter/devtools', 'version': 'git_revision:b9d7fc1a4119b3d214a77939f9d75b0c0b25d36a'}]},
252+
{'dep_type': 'cipd', 'packages': [{'package': 'dart/third_party/flutter/devtools', 'version': 'git_revision:0a0cf24dcd589e9436e266d09b6ababa09b8c70e'}]},
263253

264254
'engine/src/flutter/third_party/dart/third_party/perfetto/src':
265-
Var('android_git') + '/platform/external/perfetto' + '@' + Var('dart_perfetto_rev'),
255+
Var('chromium_git') + '/external/github.com/google/perfetto' + '@' + Var('dart_perfetto_rev'),
266256

267257
'engine/src/flutter/third_party/dart/third_party/pkg/ai':
268258
Var('dart_git') + '/ai.git' + '@' + Var('dart_ai_rev'),
@@ -271,7 +261,7 @@ deps = {
271261
Var('dart_git') + '/core.git' + '@' + Var('dart_core_rev'),
272262

273263
'engine/src/flutter/third_party/dart/third_party/pkg/dart_style':
274-
Var('dart_git') + '/dart_style.git@f624489a5013ec58de469d4fd8793c283f62b5d8',
264+
Var('dart_git') + '/dart_style.git@a6b10dcc3db33597d058cdd602c6059137550b9b',
275265

276266
'engine/src/flutter/third_party/dart/third_party/pkg/dartdoc':
277267
Var('dart_git') + '/dartdoc.git@af0085039035557c792b2d08965e24c2dd342d63',
@@ -289,7 +279,7 @@ deps = {
289279
Var('dart_git') + '/leak_tracker.git@f5620600a5ce1c44f65ddaa02001e200b096e14c',
290280

291281
'engine/src/flutter/third_party/dart/third_party/pkg/native':
292-
Var('dart_git') + '/native.git@4c78a125651d3499b616b2b0624ea35f3315d20c',
282+
Var('dart_git') + '/native.git@8c3f3ecd2e8f06b0922951e3d433f8754cb4dd4c',
293283

294284
'engine/src/flutter/third_party/dart/third_party/pkg/protobuf':
295285
Var('dart_git') + '/protobuf.git' + '@' + Var('dart_protobuf_rev'),
@@ -298,7 +288,7 @@ deps = {
298288
Var('dart_git') + '/pub.git' + '@' + Var('dart_pub_rev'),
299289

300290
'engine/src/flutter/third_party/dart/third_party/pkg/shelf':
301-
Var('dart_git') + '/shelf.git@dd830a0338b31bee92fe7ebc20b9bb963403b6b0',
291+
Var('dart_git') + '/shelf.git@6e60bbeb17b2c07613fe1d6dd02ced2d05b82cc2',
302292

303293
'engine/src/flutter/third_party/dart/third_party/pkg/sync_http':
304294
Var('dart_git') + '/sync_http.git' + '@' + Var('dart_sync_http_rev'),
@@ -307,7 +297,7 @@ deps = {
307297
Var('dart_git') + '/external/github.com/simolus3/tar.git@13479f7c2a18f499e840ad470cfcca8c579f6909',
308298

309299
'engine/src/flutter/third_party/dart/third_party/pkg/test':
310-
Var('dart_git') + '/test.git@f95c0f5c10fa9af35014117cb00ec17d2a117265',
300+
Var('dart_git') + '/test.git@5adf49a2d20c9844e393152c2984b81ecfa3b6cb',
311301

312302
'engine/src/flutter/third_party/dart/third_party/pkg/tools':
313303
Var('dart_git') + '/tools.git' + '@' + Var('dart_tools_rev'),

engine/src/build_overrides/build.gni

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ perfetto_build_with_embedder = true
1414

1515
perfetto_root_path = "//flutter/third_party/dart/third_party/perfetto/src/"
1616

17+
perfetto_protobuf_target_prefix = "//flutter/third_party/dart/third_party/perfetto/mock_protobuf"
18+
perfetto_protobuf_gni = perfetto_protobuf_target_prefix + "/proto_library.gni"

engine/src/flutter/runtime/dart_vm.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "flutter/runtime/dart_isolate.h"
2121
#include "flutter/runtime/dart_vm_initializer.h"
2222
#include "flutter/runtime/ptrace_check.h"
23+
#include "third_party/dart/runtime/bin/platform.h"
2324
#include "third_party/dart/runtime/include/bin/dart_io_api.h"
2425
#include "third_party/tonic/converter/dart_converter.h"
2526
#include "third_party/tonic/dart_class_library.h"
@@ -285,6 +286,10 @@ DartVM::DartVM(const std::shared_ptr<const DartVMData>& vm_data,
285286
FML_DCHECK(isolate_name_server_);
286287
FML_DCHECK(service_protocol_);
287288

289+
if (!dart::bin::Platform::Initialize(false)) {
290+
FML_LOG(FATAL) << "Dart platform-specific initialization failed";
291+
}
292+
288293
{
289294
TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo");
290295
dart::bin::BootstrapDartIo();

engine/src/flutter/testing/dart/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ tests = [
1616
"lerp_test.dart",
1717
"locale_test.dart",
1818
"plugin_utilities_test.dart",
19+
"process_test.dart",
1920
"serial_gc_test.dart",
2021
"spawn_helper.dart",
2122
"spawn_test.dart",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'dart:async';
6+
import 'dart:io';
7+
8+
import 'package:test/test.dart';
9+
10+
void main() {
11+
test('start process with missing executable', () async {
12+
final Future<Process> proc = Process.start('nonexistent-executable', []);
13+
expect(proc, throwsA(isA<ProcessException>()));
14+
});
15+
}

engine/src/flutter/tools/api_check/lib/apicheck.dart

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,37 @@ import 'package:analyzer/dart/analysis/results.dart';
1212
import 'package:analyzer/dart/analysis/session.dart';
1313
import 'package:analyzer/dart/analysis/utilities.dart';
1414
import 'package:analyzer/dart/ast/ast.dart';
15+
import 'package:analyzer/dart/element/element.dart';
1516

1617
/// Returns all indexed fields in [className].
1718
///
1819
/// Field names are expected to be of the form `kFooBarIndex`; prefixed with a
1920
/// `k` and terminated in `Index`.
20-
List<String> getDartClassFields({required String sourcePath, required String className}) {
21+
Future<List<String>> getDartClassFields({
22+
required String sourcePath,
23+
required String className,
24+
}) async {
2125
final includedPaths = <String>[sourcePath];
2226
final collection = AnalysisContextCollection(includedPaths: includedPaths);
2327
final AnalysisContext context = collection.contextFor(sourcePath);
2428
final AnalysisSession session = context.currentSession;
2529

26-
final SomeParsedUnitResult result = session.getParsedUnit(sourcePath);
27-
if (result is! ParsedUnitResult) {
30+
final SomeUnitElementResult result = await session.getUnitElement(sourcePath);
31+
if (result is! UnitElementResult) {
2832
return <String>[];
2933
}
3034

3135
// Locate all fields matching the expression in the class.
3236
final fieldExp = RegExp(r'_k(\w*)Index');
3337
final fields = <String>[];
34-
for (final CompilationUnitMember unitMember in result.unit.declarations) {
35-
if (unitMember is ClassDeclaration && unitMember.name.lexeme == className) {
36-
for (final ClassMember classMember in unitMember.members) {
37-
if (classMember is FieldDeclaration) {
38-
for (final VariableDeclaration field in classMember.fields.variables) {
39-
final String fieldName = field.name.lexeme;
40-
final RegExpMatch? match = fieldExp.firstMatch(fieldName);
41-
if (match != null) {
42-
fields.add(match.group(1)!);
43-
}
38+
for (final ClassFragment cls in result.fragment.classes) {
39+
if (cls.name == className) {
40+
for (final FieldFragment field in cls.fields) {
41+
final String? fieldName = field.name;
42+
if (fieldName != null) {
43+
final RegExpMatch? match = fieldExp.firstMatch(fieldName);
44+
if (match != null) {
45+
fields.add(match.group(1)!);
4446
}
4547
}
4648
}

engine/src/flutter/tools/api_check/test/apicheck_test.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ void main() {
3131
/// never done. See the note at the top of `shell/platform/embedder/embedder.h`
3232
/// for further details.
3333
void checkApiConsistency(String flutterRoot) {
34-
test('AccessibilityFeatures enums match', () {
34+
test('AccessibilityFeatures enums match', () async {
3535
// Dart values: _kFooBarIndex = 1 << N
36-
final List<String> uiFields = getDartClassFields(
36+
final List<String> uiFields = await getDartClassFields(
3737
sourcePath: path.join(flutterRoot, 'lib', 'ui', 'window.dart'),
3838
className: 'AccessibilityFeatures',
3939
);
@@ -67,13 +67,13 @@ void checkApiConsistency(String flutterRoot) {
6767
expect(javaEnumValues, uiFields);
6868
});
6969

70-
test('SemanticsAction enums match', () {
70+
test('SemanticsAction enums match', () async {
7171
// Dart values: _kFooBarIndex = 1 << N.
72-
final List<String> uiFields = getDartClassFields(
72+
final List<String> uiFields = await getDartClassFields(
7373
sourcePath: path.join(flutterRoot, 'lib', 'ui', 'semantics.dart'),
7474
className: 'SemanticsAction',
7575
);
76-
final List<String> webuiFields = getDartClassFields(
76+
final List<String> webuiFields = await getDartClassFields(
7777
sourcePath: path.join(flutterRoot, 'lib', 'web_ui', 'lib', 'semantics.dart'),
7878
className: 'SemanticsAction',
7979
);
@@ -108,13 +108,13 @@ void checkApiConsistency(String flutterRoot) {
108108
expect(javaEnumValues, uiFields);
109109
});
110110

111-
test('AppLifecycleState enums match', () {
111+
test('AppLifecycleState enums match', () async {
112112
// Dart values: _kFooBarIndex = 1 << N.
113-
final List<String> uiFields = getDartClassFields(
113+
final List<String> uiFields = await getDartClassFields(
114114
sourcePath: path.join(flutterRoot, 'lib', 'ui', 'platform_dispatcher.dart'),
115115
className: 'AppLifecycleState',
116116
);
117-
final List<String> webuiFields = getDartClassFields(
117+
final List<String> webuiFields = await getDartClassFields(
118118
sourcePath: path.join(flutterRoot, 'lib', 'web_ui', 'lib', 'platform_dispatcher.dart'),
119119
className: 'AppLifecycleState',
120120
);

engine/src/flutter/web_sdk/test/api_conform_test.dart

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,10 @@ void _collectPublicClasses(
364364
continue;
365365
}
366366
final ClassDeclaration classDeclaration = member;
367-
if (classDeclaration.name.lexeme.startsWith('_')) {
367+
if (classDeclaration.namePart.typeName.lexeme.startsWith('_')) {
368368
continue;
369369
}
370-
destination[classDeclaration.name.lexeme] = classDeclaration;
370+
destination[classDeclaration.namePart.typeName.lexeme] = classDeclaration;
371371
}
372372
}
373373
}
@@ -376,7 +376,12 @@ void _collectPublicConstructors(
376376
ClassDeclaration classDeclaration,
377377
Map<String, ConstructorDeclaration> destination,
378378
) {
379-
for (final ClassMember member in classDeclaration.members) {
379+
final ClassBody classBody = classDeclaration.body;
380+
if (classBody is! BlockClassBody) {
381+
return;
382+
}
383+
384+
for (final ClassMember member in classBody.members) {
380385
if (member is! ConstructorDeclaration) {
381386
continue;
382387
}
@@ -396,7 +401,12 @@ void _collectPublicMethods(
396401
ClassDeclaration classDeclaration,
397402
Map<String, MethodDeclaration> destination,
398403
) {
399-
for (final ClassMember member in classDeclaration.members) {
404+
final ClassBody classBody = classDeclaration.body;
405+
if (classBody is! BlockClassBody) {
406+
return;
407+
}
408+
409+
for (final ClassMember member in classBody.members) {
400410
if (member is! MethodDeclaration) {
401411
continue;
402412
}

0 commit comments

Comments
 (0)