Skip to content

Commit 68d7e34

Browse files
author
Dart CI
committed
Version 3.9.0-237.0.dev
Merge c48dd51 into dev
2 parents e8fda1e + c48dd51 commit 68d7e34

File tree

15 files changed

+156
-69
lines changed

15 files changed

+156
-69
lines changed

DEPS

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ vars = {
7878
"clang_version": "git_revision:8c7a2ce01a77c96028fe2c8566f65c45ad9408d3",
7979

8080
# https://chrome-infra-packages.appspot.com/p/gn/gn
81-
"gn_version": "git_revision:899572b32b8bb610cfeeefd162d9aefb46e29d97",
81+
"gn_version": "git_revision:54169531ed6da64425ad6e8e9535945c8f6220d0",
8282

8383
"reclient_version": "re_client_version:0.178.0.5ee9d3e8-gomaip",
8484
"download_reclient": True,
@@ -101,6 +101,8 @@ vars = {
101101
"browser-compat-data_tag": "ac8cae697014da1ff7124fba33b0b4245cc6cd1b", # v1.0.22
102102
"cpu_features_rev": "936b9ab5515dead115606559502e3864958f7f6e",
103103
"devtools_rev": "53b9620798ff824f016add0fa6c25e9cc399ea0b",
104+
# Use the SHA found in `flutter-candidate.txt` in the devtools repo.
105+
"flutter_rev": "36ea2bdeab611e908967b6fa57659998f600a2cb",
104106
"icu_rev": "43953f57b037778a1b8005564afabe214834f7bd",
105107
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
106108
"libcxx_rev": "bd557f6f764d1e40b62528a13b124ce740624f8f",
@@ -169,10 +171,12 @@ vars = {
169171
"download_emscripten": False,
170172
"emsdk_rev": "e41b8c68a248da5f18ebd03bd0420953945d52ff",
171173
"emsdk_ver": "3.1.3",
174+
"build_devtools_from_sources": False,
172175
}
173176

174177
gclient_gn_args_file = Var("dart_root") + '/build/config/gclient_args.gni'
175178
gclient_gn_args = [
179+
"build_devtools_from_sources"
176180
]
177181

178182
deps = {
@@ -251,6 +255,11 @@ deps = {
251255
}],
252256
"dep_type": "cipd",
253257
},
258+
Var("dart_root") + "/third_party/devtools_src": {
259+
"url": Var("dart_git") + "external/github.com/flutter/devtools.git" +
260+
"@" + Var("devtools_rev"),
261+
"condition": "build_devtools_from_sources",
262+
},
254263
Var("dart_root") + "/tests/co19/src": {
255264
"packages": [{
256265
"package": "dart/third_party/co19",
@@ -297,6 +306,12 @@ deps = {
297306
Var("dart_git") + "external/github.com/emscripten-core/emsdk.git" +
298307
"@" + Var("emsdk_rev"),
299308

309+
Var("dart_root") + "/third_party/flutter": {
310+
"url": Var("dart_git") + "external/github.com/flutter/flutter.git" +
311+
"@" + Var("flutter_rev"),
312+
"condition": "build_devtools_from_sources",
313+
},
314+
300315
Var("dart_root") + "/third_party/jinja2":
301316
Var("chromium_git") + "/chromium/src/third_party/jinja2.git" +
302317
"@" + Var("jinja2_rev"),

pkg/analysis_server/test/src/services/correction/fix/fix_processor.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ abstract class BaseFixProcessorTest extends AbstractSingleUnitTest {
3838
return DartChangeWorkspace([await session]);
3939
}
4040

41-
/// Computes fixes for the given [error] in [testUnit].
42-
Future<List<Fix>> _computeFixes(Diagnostic error) async {
41+
/// Computes fixes for the given [diagnostic] in [testUnit].
42+
Future<List<Fix>> _computeFixes(Diagnostic diagnostic) async {
4343
var libraryResult = testLibraryResult;
4444
if (libraryResult == null) {
4545
return const [];
@@ -49,7 +49,7 @@ abstract class BaseFixProcessorTest extends AbstractSingleUnitTest {
4949
workspace: await workspace,
5050
libraryResult: libraryResult,
5151
unitResult: testAnalysisResult,
52-
error: error,
52+
error: diagnostic,
5353
);
5454
return await computeFixes(context);
5555
}
@@ -648,9 +648,9 @@ abstract class FixProcessorTest extends BaseFixProcessorTest {
648648
}
649649
}
650650

651-
/// Computes fixes for the given [error] in [testUnit].
651+
/// Computes fixes for the given [diagnostic] in [testUnit].
652652
@override
653-
Future<List<Fix>> _computeFixes(Diagnostic error) async {
653+
Future<List<Fix>> _computeFixes(Diagnostic diagnostic) async {
654654
var libraryResult = testLibraryResult;
655655
if (libraryResult == null) {
656656
return const [];
@@ -660,7 +660,7 @@ abstract class FixProcessorTest extends BaseFixProcessorTest {
660660
workspace: await workspace,
661661
libraryResult: libraryResult,
662662
unitResult: testAnalysisResult,
663-
error: error,
663+
error: diagnostic,
664664
);
665665
return await computeFixes(context);
666666
}

pkg/analysis_server_plugin/api.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ package:analysis_server_plugin/edit/fix/dart_fix_context.dart:
115115
new (constructor: DartFixContext Function({bool autoTriggered, CorrectionUtils? correctionUtils, required Diagnostic error, required InstrumentationService instrumentationService, required ResolvedLibraryResult libraryResult, required ResolvedUnitResult unitResult, required ChangeWorkspace workspace}))
116116
autoTriggered (getter: bool)
117117
correctionUtils (getter: CorrectionUtils)
118+
diagnostic (getter: Diagnostic)
118119
error (getter: Diagnostic)
119120
instrumentationService (getter: InstrumentationService)
120121
libraryResult (getter: ResolvedLibraryResult)
@@ -131,7 +132,8 @@ package:analysis_server_plugin/edit/fix/fix.dart:
131132
toString (method: String Function())
132133
package:analysis_server_plugin/edit/fix/fix_context.dart:
133134
FixContext (class extends Object):
134-
error (getter: Diagnostic)
135+
diagnostic (getter: Diagnostic)
136+
error (getter: Diagnostic, deprecated)
135137
package:analysis_server_plugin/plugin.dart:
136138
Plugin (class extends Object):
137139
new (constructor: Plugin Function())

pkg/analysis_server_plugin/lib/edit/fix/dart_fix_context.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,22 @@ class DartFixContext implements FixContext {
5353
_cachedTopLevelDeclarations = {};
5454

5555
@override
56-
final Diagnostic error;
56+
final Diagnostic diagnostic;
5757

5858
DartFixContext({
5959
required this.instrumentationService,
6060
required this.workspace,
6161
required this.libraryResult,
6262
required this.unitResult,
63-
required this.error,
63+
// TODO(srawlins): Rename to `diagnostic`.
64+
required Diagnostic error,
6465
this.autoTriggered = false,
6566
CorrectionUtils? correctionUtils,
66-
}) : correctionUtils = correctionUtils ?? CorrectionUtils(unitResult);
67+
}) : diagnostic = error,
68+
correctionUtils = correctionUtils ?? CorrectionUtils(unitResult);
69+
70+
@override
71+
Diagnostic get error => diagnostic;
6772

6873
/// Returns the mapping from each library (that is available to this context)
6974
/// to a top-level declaration that is exported (not necessary declared) by

pkg/analysis_server_plugin/lib/edit/fix/fix_context.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
1010
/// Clients may not extend, implement or mix-in this class.
1111
abstract interface class FixContext {
1212
/// The diagnostic to fix.
13-
// TODO(srawlins): Rename to 'diagnostic'.
13+
Diagnostic get diagnostic;
14+
15+
@Deprecated("Use 'diagnostic' instead")
1416
Diagnostic get error;
1517
}

pkg/analysis_server_plugin/lib/src/correction/fix_in_file_processor.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ final class FixInFileProcessor {
2626
FixInFileProcessor(this._fixContext, {this.alreadyCalculated});
2727

2828
Future<List<Fix>> compute() async {
29-
var error = _fixContext.error;
29+
var diagnostic = _fixContext.diagnostic;
3030

31-
var generators = _getGenerators(error.diagnosticCode);
31+
var generators = _getGenerators(diagnostic.diagnosticCode);
3232

3333
String getAlreadyCalculatedValue(ProducerGenerator generator) {
34-
return '${generator.hashCode}|${error.diagnosticCode.name}';
34+
return '${generator.hashCode}|${diagnostic.diagnosticCode.name}';
3535
}
3636

3737
// Remove generators for which we've already calculated and we were asked to
@@ -48,7 +48,7 @@ final class FixInFileProcessor {
4848
}
4949

5050
var diagnostics = _fixContext.unitResult.diagnostics
51-
.where((e) => error.diagnosticCode.name == e.diagnosticCode.name);
51+
.where((e) => diagnostic.diagnosticCode.name == e.diagnosticCode.name);
5252
if (diagnostics.length < 2) {
5353
return const <Fix>[];
5454
}
@@ -68,28 +68,28 @@ final class FixInFileProcessor {
6868
workspace: _fixContext.workspace,
6969
libraryResult: _fixContext.libraryResult,
7070
unitResult: _fixContext.unitResult,
71-
error: error,
71+
error: diagnostic,
7272
correctionUtils: _fixContext.correctionUtils,
7373
);
74-
fixState = await _fixDiagnostic(fixContext, fixState, generator, error);
74+
fixState =
75+
await _fixDiagnostic(fixContext, fixState, generator, diagnostic);
7576

7677
// The original error was not fixable; continue to next generator.
7778
if (!(fixState.builder as ChangeBuilderImpl).hasEdits) {
7879
continue;
7980
}
8081

8182
// Compute fixes for the rest of the errors.
82-
for (var diagnostic in diagnostics.where((item) => item != error)) {
83+
for (var d in diagnostics.where((item) => item != diagnostic)) {
8384
var fixContext = DartFixContext(
8485
instrumentationService: _fixContext.instrumentationService,
8586
workspace: _fixContext.workspace,
8687
libraryResult: _fixContext.libraryResult,
8788
unitResult: _fixContext.unitResult,
88-
error: diagnostic,
89+
error: d,
8990
correctionUtils: _fixContext.correctionUtils,
9091
);
91-
fixState =
92-
await _fixDiagnostic(fixContext, fixState, generator, diagnostic);
92+
fixState = await _fixDiagnostic(fixContext, fixState, generator, d);
9393
}
9494
if (fixState is _NotEmptyFixState) {
9595
var sourceChange = fixState.builder.sourceChange;

pkg/analysis_server_plugin/lib/src/correction/fix_processor.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ class FixProcessor {
8181
}
8282

8383
Future<void> _addFromProducers() async {
84-
var error = _fixContext.error;
84+
var diagnostic = _fixContext.diagnostic;
8585
var context = CorrectionProducerContext.createResolved(
8686
libraryResult: _fixContext.libraryResult,
8787
unitResult: _fixContext.unitResult,
8888
dartFixContext: _fixContext,
89-
diagnostic: error,
90-
selectionOffset: _fixContext.error.offset,
91-
selectionLength: _fixContext.error.length,
89+
diagnostic: diagnostic,
90+
selectionOffset: _fixContext.diagnostic.offset,
91+
selectionLength: _fixContext.diagnostic.length,
9292
);
9393

9494
Future<void> compute(CorrectionProducer producer) async {
@@ -122,7 +122,7 @@ class FixProcessor {
122122
}
123123
}
124124

125-
var diagnosticCode = error.diagnosticCode;
125+
var diagnosticCode = diagnostic.diagnosticCode;
126126
List<ProducerGenerator>? generators;
127127
List<MultiProducerGenerator>? multiGenerators;
128128
if (diagnosticCode is LintCode) {
@@ -157,7 +157,7 @@ class FixProcessor {
157157
if (producer.fixKind == ignoreErrorAnalysisFileKind) {
158158
if (alreadyCalculated?.add('${generator.hashCode}|'
159159
'${ignoreErrorAnalysisFileKind.id}|'
160-
'${error.diagnosticCode.name}') ==
160+
'${diagnostic.diagnosticCode.name}') ==
161161
false) {
162162
// We did this before and was asked to not do it again. Skip.
163163
continue;

pkg/dartdev/test/commands/create_integration_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void defineCreateTests() {
133133
print('stdout: $e');
134134
if (e.contains('[SEVERE]') ||
135135
(isServerTemplate && e.contains('Server listening on port')) ||
136-
(isWebTemplate && e.contains('Succeeded after'))) {
136+
(isWebTemplate && e.contains('Built with build_runner'))) {
137137
if (e.contains('[SEVERE]')) {
138138
hasError = true;
139139
}

pkg/observatory/OWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set noparent
2+
file:/tools/OWNERS_VM
3+
# In addition to VM team allow global owners.
4+
file:/OWNERS

pkg/observatory/bin/observatory.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,9 @@ ${result.stderr}
9090
]);
9191
final uriCompleter = Completer<String>();
9292
final uriRegExp = RegExp('Serving `web` on (http://.*)');
93-
late StreamSubscription<String> sub;
94-
sub = process.stdout.transform(utf8.decoder).listen((e) {
93+
final sub = process.stdout.transform(utf8.decoder).listen((e) {
9594
if (uriRegExp.hasMatch(e)) {
9695
uriCompleter.complete(uriRegExp.firstMatch(e)!.group(1));
97-
sub.cancel();
9896
}
9997
});
10098

@@ -105,6 +103,11 @@ ${result.stderr}
105103
Chrome.start(<String>[observatoryUri]);
106104
}
107105
await process.exitCode;
106+
107+
// Don't cancel this stream until the process has exited as it will close
108+
// the file descriptor for stdout and cause a crash when webdev tries to
109+
// write logs.
110+
await sub.cancel();
108111
}
109112

110113
String _findObservatoryProjectRoot() {

0 commit comments

Comments
 (0)