Reapply "[ CLI ] Don't disable DDS when --disable-dart-dev is provided"

This reverts commit 9f5246e8c6.

TEST=Existing tests

Change-Id: I658290f248d8b26c05f24b7125c3ba71de318bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385121
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
Ben Konyi
2024-09-26 15:29:05 +00:00
committed by Commit Queue
parent a4a9c59772
commit 12d9f40961
12 changed files with 22 additions and 38 deletions
@@ -549,12 +549,19 @@ class Server {
// Guard against lines like:
// {"event":"server.connected","params":{...}}The Dart VM service is listening on ...
var dartVMServiceMessage = 'The Dart VM service is listening on ';
const dartVMServiceMessage = 'The Dart VM service is listening on ';
if (trimmedLine.contains(dartVMServiceMessage)) {
trimmedLine = trimmedLine
.substring(0, trimmedLine.indexOf(dartVMServiceMessage))
.trim();
}
const devtoolsMessage =
'The Dart DevTools debugger and profiler is available at:';
if (trimmedLine.contains(devtoolsMessage)) {
trimmedLine = trimmedLine
.substring(0, trimmedLine.indexOf(devtoolsMessage))
.trim();
}
if (trimmedLine.isEmpty) {
return;
}
+1 -1
View File
@@ -220,7 +220,7 @@ Future<void> main() async {
}) async {
targetProjectInstance = await targetProject.start(
[
'--disable-dart-dev',
'--no-dds',
'--observe=0',
if (disableServiceAuthCodes) '--disable-service-auth-codes',
targetProject.relativeFilePath,
+1 -1
View File
@@ -44,7 +44,7 @@ Future<io.Process> spawnDartProcess(
final serviceInfoFile = await io.File.fromUri(serviceInfoUri).create();
final arguments = [
'--disable-dart-dev',
'--no-dds',
'--observe=0',
if (!serveObservatory) '--no-serve-observatory',
if (pauseOnStart) '--pause-isolates-on-start',
+1 -3
View File
@@ -95,9 +95,7 @@ abstract class TestCase {
'--enable-vm-service=0', // Note: use 0 to avoid port collisions.
'--pause_isolates_on_start',
'--disable-service-auth-codes',
// TODO(bkonyi): The service isolate starts before DartDev has a chance
// to spawn DDS. We should suppress the Observatory message until DDS
// starts (#42727).
'--no-dds',
'--disable-dart-dev',
outputUri.toFilePath()
];
@@ -503,7 +503,6 @@ main() {
"--pause-isolates-on-exit",
"--enable-vm-service:0",
"--disable-service-auth-codes",
"--disable-dart-dev",
list.path
]);
@@ -607,7 +606,6 @@ main() {
"--pause-isolates-on-exit",
"--enable-vm-service:0",
"--disable-service-auth-codes",
"--disable-dart-dev",
list.path
]);
@@ -873,7 +871,6 @@ main() {
"--pause-isolates-on-exit",
"--enable-vm-service:0",
"--disable-service-auth-codes",
"--disable-dart-dev",
list.path
]);
@@ -955,7 +952,6 @@ main() {
'--enable-vm-service=0', // Note: use 0 to avoid port collisions.
'--pause_isolates_on_start',
'--disable-service-auth-codes',
'--disable-dart-dev',
outputFile.path
];
final vm = await Process.start(Platform.resolvedExecutable, vmArgs);
@@ -1363,7 +1359,6 @@ main() {
"--pause-isolates-on-start",
"--enable-vm-service:0",
"--disable-service-auth-codes",
"--disable-dart-dev",
scriptOrDill.path
]);
+1 -1
View File
@@ -19,7 +19,7 @@ Future<(Process, Uri)> spawnDartProcess(
final serviceInfoFile = await File.fromUri(serviceInfoUri).create();
final arguments = [
'--disable-dart-dev',
'--no-dds',
'--observe=0',
if (!serveObservatory) '--no-serve-observatory',
if (pauseOnStart) '--pause-isolates-on-start',
@@ -7,22 +7,10 @@ import 'package:vm_service/vm_service.dart';
import 'common/test_helper.dart';
/// [expectMissingProtocol] allows for a single protocol to be missing. See
/// https://github.com/dart-lang/sdk/issues/54835 for context. This test will
/// fail without this flag on AOT configurations when DDS is expected since DDS
/// isn't currently setup to run with dart_precompiled_runtime. This flag is
/// meant to cause this test to fail if
/// https://github.com/dart-lang/sdk/issues/54841 is resolved so this test can
/// be updated.
VMTest expectedProtocolTest(
List<String> expectedProtocols, {
bool expectMissingProtocol = false,
}) =>
VMTest expectedProtocolTest(List<String> expectedProtocols) =>
(VmService service) async {
final protocols = (await service.getSupportedProtocols()).protocols!;
final expectedLength =
expectedProtocols.length - (expectMissingProtocol ? 1 : 0);
expect(protocols.length, expectedLength);
expect(protocols.length, expectedProtocols.length);
for (final protocol in protocols) {
expect(expectedProtocols.contains(protocol.protocolName), true);
expect(protocol.minor, greaterThanOrEqualTo(0));
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
import 'common/test_helper.dart';
import 'get_supported_protocols_common.dart';
@@ -13,9 +11,6 @@ final tests = <VMTest>[
'VM Service',
'DDS',
],
// See https://github.com/dart-lang/sdk/issues/54841
expectMissingProtocol:
Platform.script.toString().endsWith('out.aotsnapshot'),
),
];
+4 -1
View File
@@ -54,7 +54,10 @@ void main() {
],
);
final service = await vmServiceConnectUri(wsUri.toString());
final vm = await service.getVM();
VM vm;
do {
vm = await service.getVM();
} while (vm.isolates!.isEmpty);
final isolate = vm.isolates!.first;
final errorCompleter = Completer<RPCError>();
final stackTraceCompleter = Completer<StackTrace>();
+2 -5
View File
@@ -557,11 +557,8 @@ static Dart_Isolate CreateAndSetupServiceIsolate(const char* script_uri,
result = Dart_SetDeferredLoadHandler(Loader::DeferredLoadHandler);
CHECK_RESULT(result);
// We do not spawn the external dds process in the following scenarios:
// - The DartDev CLI is disabled and VM service is enabled.
// - DDS is disabled.
bool wait_for_dds_to_advertise_service =
!(Options::disable_dart_dev() || Options::disable_dds());
// We do not spawn the external dds process if DDS is explicitly disabled.
bool wait_for_dds_to_advertise_service = !Options::disable_dds();
bool serve_devtools =
Options::enable_devtools() || !Options::disable_devtools();
// Load embedder specific bits and return.
@@ -127,7 +127,7 @@ Future<Reloader> launchOn(String file, {bool verbose = false}) async {
if (verbose) '--trace-reload',
if (verbose) '--trace-reload-verbose',
'--enable-vm-service:0',
'--disable-dart-dev',
'--no-dds',
'--disable-service-auth-codes',
file
];
@@ -30,6 +30,7 @@ class Testee {
final processArgs = [
...Platform.executableArguments,
'--disable-dart-dev',
'--no-dds',
'--disable-service-auth-codes',
'--enable-vm-service:0',
'--pause-isolates-on-exit',