[ Observatory ] Disable serving Observatory by default

Observatory can still be enabled by providing `--serve-observatory` or
invoking the `_serveObservatory` private service RPC via web socket or
HTTP.

Related to https://github.com/dart-lang/sdk/issues/50233

TEST=pkg/dartdev/test/commands/run_test

Change-Id: I89b000e69bb31c91a9a5386fed1ee590cdafa58c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287821
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
Ben Konyi 2023-03-10 16:01:41 +00:00 committed by Commit Queue
parent 4751ed0bb8
commit edead9cfd1
5 changed files with 10 additions and 4 deletions

View file

@ -157,6 +157,11 @@
### Tools
#### Observatory
- Observatory is no longer served by default and users should instead use Dart
DevTools. Users requiring specific functionality in Observatory should set
the `--serve-observatory` flag.
#### Web Dev Compiler (DDC)
- Removed deprecated command line flags `-k`, `--kernel`, and `--dart-sdk`.

View file

@ -615,7 +615,7 @@ void main(List<String> args) => print("$b $args");
'--enable-vm-service',
if (!withDds) '--no-dds',
if (!enableAuthCodes) '--disable-service-auth-codes',
if (!serve) '--no-serve-observatory',
if (serve) '--serve-observatory',
p.relativeFilePath,
]);

View file

@ -558,7 +558,7 @@ static Dart_Isolate CreateAndSetupServiceIsolate(const char* script_uri,
Options::vm_service_auth_disabled(),
Options::vm_write_service_info_filename(), Options::trace_loading(),
Options::deterministic(), Options::enable_service_port_fallback(),
wait_for_dds_to_advertise_service, !Options::disable_observatory())) {
wait_for_dds_to_advertise_service, Options::enable_observatory())) {
*error = Utils::StrDup(VmService::GetErrorMessage());
return NULL;
}

View file

@ -49,7 +49,8 @@ namespace bin {
V(bypass_trusting_system_roots, bypass_trusting_system_roots) \
V(delayed_filewatch_callback, delayed_filewatch_callback) \
V(mark_main_isolate_as_system_isolate, mark_main_isolate_as_system_isolate) \
V(no_serve_observatory, disable_observatory)
V(no_serve_observatory, disable_observatory) \
V(serve_observatory, enable_observatory)
// Boolean flags that have a short form.
#define SHORT_BOOL_OPTIONS_LIST(V) \

View file

@ -40,7 +40,7 @@ bool _enableServicePortFallback = false;
@pragma("vm:entry-point")
bool _waitForDdsToAdvertiseService = false;
@pragma("vm:entry-point", !const bool.fromEnvironment('dart.vm.product'))
bool _serveObservatory = true;
bool _serveObservatory = false;
// HTTP server.
Server? server;