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

This reverts commit 81b9957bdd.

Reason for revert: Breaking multiple configurations.

Original change's description:
> [ CLI ] Don't disable DDS when --disable-dart-dev is provided
>
> Fixes https://github.com/dart-lang/sdk/issues/56605
> Fixes https://github.com/dart-lang/sdk/issues/54841
>
> TEST=N/A
>
> Change-Id: I6a13afe5f51fe67d2366c6d87ae74473651e24c8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383780
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Auto-Submit: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Phil Quitslund <pquitslund@google.com>

Change-Id: I5c6cb302d8160f19bad437341cdcd80bcc08d921
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384881
Reviewed-by: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This commit is contained in:
Ben Konyi 2024-09-12 01:15:27 +00:00 committed by Commit Queue
parent 28b9898433
commit 9f5246e8c6
12 changed files with 38 additions and 22 deletions

View file

@ -551,19 +551,12 @@ class Server {
// Guard against lines like:
// {"event":"server.connected","params":{...}}The Dart VM service is listening on ...
const dartVMServiceMessage = 'The Dart VM service is listening on ';
var 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;
}

View file

@ -220,7 +220,7 @@ Future<void> main() async {
}) async {
targetProjectInstance = await targetProject.start(
[
'--no-dds',
'--disable-dart-dev',
'--observe=0',
if (disableServiceAuthCodes) '--disable-service-auth-codes',
targetProject.relativeFilePath,

View file

@ -44,7 +44,7 @@ Future<io.Process> spawnDartProcess(
final serviceInfoFile = await io.File.fromUri(serviceInfoUri).create();
final arguments = [
'--no-dds',
'--disable-dart-dev',
'--observe=0',
if (!serveObservatory) '--no-serve-observatory',
if (pauseOnStart) '--pause-isolates-on-start',

View file

@ -95,7 +95,9 @@ abstract class TestCase {
'--enable-vm-service=0', // Note: use 0 to avoid port collisions.
'--pause_isolates_on_start',
'--disable-service-auth-codes',
'--no-dds',
// TODO(bkonyi): The service isolate starts before DartDev has a chance
// to spawn DDS. We should suppress the Observatory message until DDS
// starts (#42727).
'--disable-dart-dev',
outputUri.toFilePath()
];

View file

@ -503,6 +503,7 @@ main() {
"--pause-isolates-on-exit",
"--enable-vm-service:0",
"--disable-service-auth-codes",
"--disable-dart-dev",
list.path
]);
@ -606,6 +607,7 @@ main() {
"--pause-isolates-on-exit",
"--enable-vm-service:0",
"--disable-service-auth-codes",
"--disable-dart-dev",
list.path
]);
@ -871,6 +873,7 @@ main() {
"--pause-isolates-on-exit",
"--enable-vm-service:0",
"--disable-service-auth-codes",
"--disable-dart-dev",
list.path
]);
@ -952,6 +955,7 @@ 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);
@ -1359,6 +1363,7 @@ main() {
"--pause-isolates-on-start",
"--enable-vm-service:0",
"--disable-service-auth-codes",
"--disable-dart-dev",
scriptOrDill.path
]);

View file

@ -19,7 +19,7 @@ Future<(Process, Uri)> spawnDartProcess(
final serviceInfoFile = await File.fromUri(serviceInfoUri).create();
final arguments = [
'--no-dds',
'--disable-dart-dev',
'--observe=0',
if (!serveObservatory) '--no-serve-observatory',
if (pauseOnStart) '--pause-isolates-on-start',

View file

@ -7,10 +7,22 @@ import 'package:vm_service/vm_service.dart';
import 'common/test_helper.dart';
VMTest expectedProtocolTest(List<String> expectedProtocols) =>
/// [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,
}) =>
(VmService service) async {
final protocols = (await service.getSupportedProtocols()).protocols!;
expect(protocols.length, expectedProtocols.length);
final expectedLength =
expectedProtocols.length - (expectMissingProtocol ? 1 : 0);
expect(protocols.length, expectedLength);
for (final protocol in protocols) {
expect(expectedProtocols.contains(protocol.protocolName), true);
expect(protocol.minor, greaterThanOrEqualTo(0));

View file

@ -2,6 +2,8 @@
// 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';
@ -11,6 +13,9 @@ final tests = <VMTest>[
'VM Service',
'DDS',
],
// See https://github.com/dart-lang/sdk/issues/54841
expectMissingProtocol:
Platform.script.toString().endsWith('out.aotsnapshot'),
),
];

View file

@ -54,10 +54,7 @@ void main() {
],
);
final service = await vmServiceConnectUri(wsUri.toString());
VM vm;
do {
vm = await service.getVM();
} while (vm.isolates!.isEmpty);
final vm = await service.getVM();
final isolate = vm.isolates!.first;
final errorCompleter = Completer<RPCError>();
final stackTraceCompleter = Completer<StackTrace>();

View file

@ -557,8 +557,11 @@ static Dart_Isolate CreateAndSetupServiceIsolate(const char* script_uri,
result = Dart_SetDeferredLoadHandler(Loader::DeferredLoadHandler);
CHECK_RESULT(result);
// We do not spawn the external dds process if DDS is explicitly disabled.
bool wait_for_dds_to_advertise_service = !Options::disable_dds();
// 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());
bool serve_devtools =
Options::enable_devtools() || !Options::disable_devtools();
// Load embedder specific bits and return.

View file

@ -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',
'--no-dds',
'--disable-dart-dev',
'--disable-service-auth-codes',
file
];

View file

@ -30,7 +30,6 @@ class Testee {
final processArgs = [
...Platform.executableArguments,
'--disable-dart-dev',
'--no-dds',
'--disable-service-auth-codes',
'--enable-vm-service:0',
'--pause-isolates-on-exit',