Skip to content

Commit 2ae25cc

Browse files
authored
Revert "Re-enable the Dart Development Service (DDS) (#64671)" (#64797)
This reverts commit d7d1241.
1 parent cad4d13 commit 2ae25cc

23 files changed

Lines changed: 55 additions & 111 deletions

packages/flutter_tools/lib/src/android/android_device.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ class AndroidDevice extends Device {
620620
observatoryDiscovery = ProtocolDiscovery.observatory(
621621
await getLogReader(),
622622
portForwarder: portForwarder,
623-
hostPort: debuggingOptions.disableDds ? debuggingOptions.hostVmServicePort : 0,
623+
hostPort: debuggingOptions.hostVmServicePort,
624624
devicePort: debuggingOptions.deviceVmServicePort,
625625
ipv6: ipv6,
626626
);

packages/flutter_tools/lib/src/base/dds.dart

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,30 @@ import 'logger.dart';
1515
class DartDevelopmentService {
1616
DartDevelopmentService({@required this.logger});
1717

18+
// TODO(bkonyi): enable once VM service can handle SSE forwarding for
19+
// Devtools (https://github.com/flutter/flutter/issues/62507)
20+
static const bool ddsDisabled = true;
1821
final Logger logger;
1922
dds.DartDevelopmentService _ddsInstance;
2023

21-
Uri get uri => _ddsInstance.uri;
22-
2324
Future<void> startDartDevelopmentService(
2425
Uri observatoryUri,
25-
int hostPort,
2626
bool ipv6,
27-
bool disableServiceAuthCodes,
2827
) async {
28+
if (ddsDisabled) {
29+
logger.printTrace(
30+
'DDS is currently disabled due to '
31+
'https://github.com/flutter/flutter/issues/62507'
32+
);
33+
return;
34+
}
2935
final Uri ddsUri = Uri(
3036
scheme: 'http',
3137
host: (ipv6 ?
3238
io.InternetAddress.loopbackIPv6 :
3339
io.InternetAddress.loopbackIPv4
3440
).host,
35-
port: hostPort ?? 0,
41+
port: 0,
3642
);
3743
logger.printTrace(
3844
'Launching a Dart Developer Service (DDS) instance at $ddsUri, '
@@ -42,7 +48,6 @@ class DartDevelopmentService {
4248
_ddsInstance = await dds.DartDevelopmentService.startDartDevelopmentService(
4349
observatoryUri,
4450
serviceUri: ddsUri,
45-
enableAuthCodes: !disableServiceAuthCodes,
4651
);
4752
logger.printTrace('DDS is listening at ${_ddsInstance.uri}.');
4853
} on dds.DartDevelopmentServiceException catch (e) {

packages/flutter_tools/lib/src/commands/drive.dart

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,7 @@ class DriveCommand extends RunCommandBase {
240240
// If there's another flutter_tools instance still connected to the target
241241
// application, DDS will already be running remotely and this call will fail.
242242
// We can ignore this and continue to use the remote DDS instance.
243-
await device.dds.startDartDevelopmentService(
244-
Uri.parse(observatoryUri),
245-
hostVmservicePort,
246-
ipv6,
247-
disableServiceAuthCodes,
248-
);
243+
await device.dds.startDartDevelopmentService(Uri.parse(observatoryUri), ipv6);
249244
} on dds.DartDevelopmentServiceException catch(_) {
250245
globals.printTrace('Note: DDS is already connected to $observatoryUri.');
251246
}
@@ -483,7 +478,7 @@ Future<LaunchResult> _startApp(
483478
debuggingOptions: DebuggingOptions.enabled(
484479
command.getBuildInfo(),
485480
startPaused: true,
486-
hostVmServicePort: (webUri != null || command.disableDds) ? command.hostVmservicePort : 0,
481+
hostVmServicePort: command.hostVmservicePort,
487482
verboseSystemLogs: command.verboseSystemLogs,
488483
cacheSkSL: command.cacheSkSL,
489484
dumpSkpOnShaderCompilation: command.dumpSkpOnShaderCompilation,

packages/flutter_tools/lib/src/commands/run.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
6666
help: 'A file to write the attached vmservice uri to after an'
6767
' application is started.',
6868
valueHelp: 'project/example/out.txt'
69-
)
70-
..addFlag('disable-service-auth-codes',
71-
negatable: false,
72-
hide: !verboseHelp,
73-
help: 'No longer require an authentication code to connect to the VM '
74-
'service (not recommended).');
69+
);
7570
usesWebOptions(hide: !verboseHelp);
7671
usesTargetOption();
7772
usesPortOptions();
@@ -80,14 +75,13 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
8075
usesTrackWidgetCreation(verboseHelp: verboseHelp);
8176
addNullSafetyModeOptions(hide: !verboseHelp);
8277
usesDeviceUserOption();
83-
addDdsOptions(verboseHelp: verboseHelp);
8478
}
8579

8680
bool get traceStartup => boolArg('trace-startup');
8781
bool get cacheSkSL => boolArg('cache-sksl');
8882
bool get dumpSkpOnShaderCompilation => boolArg('dump-skp-on-shader-compilation');
8983
bool get purgePersistentCache => boolArg('purge-persistent-cache');
90-
bool get disableServiceAuthCodes => boolArg('disable-service-auth-codes');
84+
9185
String get route => stringArg('route');
9286
}
9387

@@ -211,6 +205,11 @@ class RunCommand extends RunCommandBase {
211205
'results out to "refresh_benchmark.json", and exit. This flag is '
212206
'intended for use in generating automated flutter benchmarks.',
213207
)
208+
..addFlag('disable-service-auth-codes',
209+
negatable: false,
210+
hide: !verboseHelp,
211+
help: 'No longer require an authentication code to connect to the VM '
212+
'service (not recommended).')
214213
..addFlag('web-initialize-platform',
215214
negatable: true,
216215
defaultsTo: true,
@@ -227,6 +226,7 @@ class RunCommand extends RunCommandBase {
227226
'Currently this is only supported on Android devices. This option '
228227
'cannot be paired with --use-application-binary.'
229228
);
229+
addDdsOptions(verboseHelp: verboseHelp);
230230
}
231231

232232
@override

packages/flutter_tools/lib/src/commands/test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ class TestCommand extends FlutterCommand {
130130
'This flag is ignored if --start-paused or coverage are requested. '
131131
'The vmservice will be enabled no matter what in those cases.'
132132
);
133-
addDdsOptions(verboseHelp: verboseHelp);
134133
}
135134

136135
/// The interface for starting and configuring the tester.
@@ -255,7 +254,6 @@ class TestCommand extends FlutterCommand {
255254
enableObservatory: collector != null || startPaused || boolArg('enable-vmservice'),
256255
startPaused: startPaused,
257256
disableServiceAuthCodes: disableServiceAuthCodes,
258-
disableDds: disableDds,
259257
ipv6: boolArg('ipv6'),
260258
machine: machine,
261259
buildMode: BuildMode.debug,

packages/flutter_tools/lib/src/desktop_device.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ abstract class DesktopDevice extends Device {
134134
}
135135
final ProtocolDiscovery observatoryDiscovery = ProtocolDiscovery.observatory(_deviceLogReader,
136136
devicePort: debuggingOptions?.deviceVmServicePort,
137-
hostPort: (debuggingOptions?.disableDds ?? false) ? debuggingOptions?.hostVmServicePort : 0,
137+
hostPort: debuggingOptions?.hostVmServicePort,
138138
ipv6: ipv6,
139139
);
140140
try {

packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,8 @@ Future<vm_service.VmService> _kDefaultFuchsiaIsolateDiscoveryConnector(Uri uri)
5555
Future<void> _kDefaultDartDevelopmentServiceStarter(
5656
Device device,
5757
Uri observatoryUri,
58-
bool disableServiceAuthCodes,
5958
) async {
60-
await device.dds.startDartDevelopmentService(
61-
observatoryUri,
62-
0,
63-
true,
64-
disableServiceAuthCodes,
65-
);
59+
await device.dds.startDartDevelopmentService(observatoryUri, true);
6660
}
6761

6862
/// Read the log for a particular device.
@@ -744,7 +738,7 @@ class FuchsiaIsolateDiscoveryProtocol {
744738
final String _isolateName;
745739
final Completer<Uri> _foundUri = Completer<Uri>();
746740
final Future<vm_service.VmService> Function(Uri) _vmServiceConnector;
747-
final Future<void> Function(Device, Uri, bool) _ddsStarter;
741+
final Future<void> Function(Device, Uri) _ddsStarter;
748742
// whether to only poll once.
749743
final bool _pollOnce;
750744
Timer _pollingTimer;
@@ -787,8 +781,8 @@ class FuchsiaIsolateDiscoveryProtocol {
787781
final int localPort = await _device.portForwarder.forward(port);
788782
try {
789783
final Uri uri = Uri.parse('http://[$_ipv6Loopback]:$localPort');
790-
await _ddsStarter(_device, uri, true);
791-
service = await _vmServiceConnector(_device.dds.uri);
784+
await _ddsStarter(_device, uri);
785+
service = await _vmServiceConnector(uri);
792786
_ports[port] = service;
793787
} on SocketException catch (err) {
794788
globals.printTrace('Failed to connect to $localPort: $err');

packages/flutter_tools/lib/src/ios/devices.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ class IOSDevice extends Device {
399399
observatoryDiscovery = ProtocolDiscovery.observatory(
400400
getLogReader(app: package),
401401
portForwarder: portForwarder,
402-
hostPort: debuggingOptions.disableDds ? debuggingOptions.hostVmServicePort : 0,
402+
hostPort: debuggingOptions.hostVmServicePort,
403403
devicePort: debuggingOptions.deviceVmServicePort,
404404
ipv6: ipv6,
405405
);
@@ -436,7 +436,7 @@ class IOSDevice extends Device {
436436
assumedDevicePort: assumedObservatoryPort,
437437
device: this,
438438
usesIpv6: ipv6,
439-
hostVmservicePort: debuggingOptions.disableDds ? debuggingOptions.hostVmServicePort : 0,
439+
hostVmservicePort: debuggingOptions.hostVmServicePort,
440440
packageId: packageId,
441441
packageName: FlutterProject.current().manifest.appName,
442442
);

packages/flutter_tools/lib/src/ios/simulators.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,8 @@ class IOSSimulator extends Device {
424424
if (debuggingOptions.skiaDeterministicRendering) '--skia-deterministic-rendering',
425425
if (debuggingOptions.useTestFonts) '--use-test-fonts',
426426
if (debuggingOptions.traceAllowlist != null) '--trace-allowlist="${debuggingOptions.traceAllowlist}"',
427-
if (dartVmFlags.isNotEmpty) '--dart-flags=$dartVmFlags',
428-
if (debuggingOptions.disableDds)
429-
'--observatory-port=${debuggingOptions.hostVmServicePort ?? 0}'
430-
else
431-
'--observatory-port=0'
427+
if (dartVmFlags.isNotEmpty) '--dart-flags=$dartVmFlags'
428+
'--observatory-port=${debuggingOptions.hostVmServicePort ?? 0}',
432429
],
433430
];
434431

@@ -437,7 +434,7 @@ class IOSSimulator extends Device {
437434
observatoryDiscovery = ProtocolDiscovery.observatory(
438435
getLogReader(app: package),
439436
ipv6: ipv6,
440-
hostPort: debuggingOptions.disableDds ? debuggingOptions.hostVmServicePort : 0,
437+
hostPort: debuggingOptions.hostVmServicePort,
441438
devicePort: debuggingOptions.deviceVmServicePort,
442439
);
443440
}

packages/flutter_tools/lib/src/resident_runner.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ class FlutterDevice {
205205
ReloadMethod reloadMethod,
206206
GetSkSLMethod getSkSLMethod,
207207
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
208-
int hostVmServicePort,
209-
bool disableServiceAuthCodes = false,
210208
bool disableDds = false,
211209
bool ipv6 = false,
212210
}) {
@@ -222,14 +220,12 @@ class FlutterDevice {
222220
if (!disableDds) {
223221
await device.dds.startDartDevelopmentService(
224222
observatoryUri,
225-
hostVmServicePort,
226223
ipv6,
227-
disableServiceAuthCodes,
228224
);
229225
}
230226
try {
231227
service = await connectToVmService(
232-
disableDds ? observatoryUri : device.dds.uri,
228+
observatoryUri,
233229
reloadSources: reloadSources,
234230
restart: restart,
235231
compileExpression: compileExpression,
@@ -1236,12 +1232,10 @@ abstract class ResidentRunner {
12361232
restart: restart,
12371233
compileExpression: compileExpression,
12381234
disableDds: debuggingOptions.disableDds,
1239-
hostVmServicePort: debuggingOptions.hostVmServicePort,
12401235
reloadMethod: reloadMethod,
12411236
getSkSLMethod: getSkSLMethod,
12421237
printStructuredErrorLogMethod: printStructuredErrorLog,
12431238
ipv6: ipv6,
1244-
disableServiceAuthCodes: debuggingOptions.disableServiceAuthCodes
12451239
);
12461240
// This will wait for at least one flutter view before returning.
12471241
final Status status = globals.logger.startProgress(

0 commit comments

Comments
 (0)