Revert "Reland "[ Observatory ] Disable serving Observatory by default""
This reverts commit fb1516c4ea52111f05a96d9eaedffc1e6feed000.
Reason for revert: https://github.com/flutter/flutter/issues/123516
Original change's description:
> Reland "[ Observatory ] Disable serving Observatory by default"
>
> This reverts commit 5a8ddc0756684e8ebfbc0edfbfc6046755b8394a.
>
> Reason for reland: fix for failing Flutter test landed upstream
> in https://github.com/flutter/flutter/pull/122419
>
> TEST=pkg/dartdev/test/commands/run_test.dart
>
> Change-Id: I1152296828428e118ccba11025f25f6b1dbbb0f3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290921
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>
Change-Id: I4e35f93ef4ac46c6dbd905903496a27107eb8329
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291180
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b205a38..64cd46a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -168,11 +168,6 @@
### 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`.
diff --git a/pkg/dartdev/test/commands/run_test.dart b/pkg/dartdev/test/commands/run_test.dart
index 962d61d..66e9b01 100644
--- a/pkg/dartdev/test/commands/run_test.dart
+++ b/pkg/dartdev/test/commands/run_test.dart
@@ -641,7 +641,7 @@
'--enable-vm-service=0',
if (!withDds) '--no-dds',
if (!enableAuthCodes) '--disable-service-auth-codes',
- if (serve) '--serve-observatory',
+ if (!serve) '--no-serve-observatory',
p.relativeFilePath,
]);
diff --git a/runtime/bin/main_impl.cc b/runtime/bin/main_impl.cc
index ea7a397..4faa54e 100644
--- a/runtime/bin/main_impl.cc
+++ b/runtime/bin/main_impl.cc
@@ -558,7 +558,7 @@
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::enable_observatory())) {
+ wait_for_dds_to_advertise_service, !Options::disable_observatory())) {
*error = Utils::StrDup(VmService::GetErrorMessage());
return NULL;
}
diff --git a/runtime/bin/main_options.h b/runtime/bin/main_options.h
index 895c61a..8cfcfcd 100644
--- a/runtime/bin/main_options.h
+++ b/runtime/bin/main_options.h
@@ -49,8 +49,7 @@
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(serve_observatory, enable_observatory)
+ V(no_serve_observatory, disable_observatory)
// Boolean flags that have a short form.
#define SHORT_BOOL_OPTIONS_LIST(V) \
diff --git a/sdk/lib/_internal/vm/bin/vmservice_io.dart b/sdk/lib/_internal/vm/bin/vmservice_io.dart
index 668734f..0b1c6ae 100644
--- a/sdk/lib/_internal/vm/bin/vmservice_io.dart
+++ b/sdk/lib/_internal/vm/bin/vmservice_io.dart
@@ -40,7 +40,7 @@
@pragma("vm:entry-point")
bool _waitForDdsToAdvertiseService = false;
@pragma("vm:entry-point", !const bool.fromEnvironment('dart.vm.product'))
-bool _serveObservatory = false;
+bool _serveObservatory = true;
// HTTP server.
Server? server;