Skip to content

Commit 51eef3d

Browse files
authored
Remove Observatory build rules and remaining references from the engine (flutter#169945)
Work towards dart-lang/sdk#50233 FYI @a-siva
1 parent 2c51fce commit 51eef3d

File tree

15 files changed

+5
-103
lines changed

15 files changed

+5
-103
lines changed

engine/src/flutter/runtime/BUILD.gn

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,6 @@ source_set("runtime") {
118118
"//flutter/third_party/tonic",
119119
"//flutter/txt",
120120
]
121-
122-
if (flutter_runtime_mode != "release" && !is_fuchsia) {
123-
# Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia
124-
# instead puts Observatory into the runner's package.
125-
deps += [ "$dart_src/runtime/observatory:embedded_observatory_archive" ]
126-
}
127121
}
128122

129123
if (enable_unittests) {

engine/src/flutter/runtime/dart_vm.cc

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,6 @@
2828
#include "third_party/tonic/logging/dart_error.h"
2929
#include "third_party/tonic/typed_data/typed_list.h"
3030

31-
namespace dart {
32-
namespace observatory {
33-
34-
#if !OS_FUCHSIA && !FLUTTER_RELEASE
35-
36-
// These two symbols are defined in |observatory_archive.cc| which is generated
37-
// by the |//third_party/dart/runtime/observatory:archive_observatory| rule.
38-
// Both of these symbols will be part of the data segment and therefore are read
39-
// only.
40-
extern unsigned int observatory_assets_archive_len;
41-
extern const uint8_t* observatory_assets_archive;
42-
43-
#endif // !OS_FUCHSIA && !FLUTTER_RELEASE
44-
45-
} // namespace observatory
46-
} // namespace dart
47-
4831
namespace flutter {
4932

5033
// Arguments passed to the Dart VM in all configurations.
@@ -158,26 +141,6 @@ bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) {
158141

159142
void ThreadExitCallback() {}
160143

161-
Dart_Handle GetVMServiceAssetsArchiveCallback() {
162-
#if FLUTTER_RELEASE
163-
return nullptr;
164-
#elif OS_FUCHSIA
165-
fml::UniqueFD fd = fml::OpenFile("pkg/data/observatory.tar", false,
166-
fml::FilePermission::kRead);
167-
fml::FileMapping mapping(fd, {fml::FileMapping::Protection::kRead});
168-
if (mapping.GetSize() == 0 || mapping.GetMapping() == nullptr) {
169-
FML_LOG(ERROR) << "Fail to load Observatory archive";
170-
return nullptr;
171-
}
172-
return tonic::DartConverter<tonic::Uint8List>::ToDart(mapping.GetMapping(),
173-
mapping.GetSize());
174-
#else
175-
return tonic::DartConverter<tonic::Uint8List>::ToDart(
176-
::dart::observatory::observatory_assets_archive,
177-
::dart::observatory::observatory_assets_archive_len);
178-
#endif
179-
}
180-
181144
static const char kStdoutStreamId[] = "Stdout";
182145
static const char kStderrStreamId[] = "Stderr";
183146

@@ -472,7 +435,6 @@ DartVM::DartVM(const std::shared_ptr<const DartVMData>& vm_data,
472435
params.file_write = dart::bin::WriteFile;
473436
params.file_close = dart::bin::CloseFile;
474437
params.entropy_source = dart::bin::GetEntropy;
475-
params.get_service_assets = GetVMServiceAssetsArchiveCallback;
476438
DartVMInitializer::Initialize(&params,
477439
settings_.enable_timeline_event_handler,
478440
settings_.trace_systrace);

engine/src/flutter/shell/platform/fuchsia/dart_runner/BUILD.gn

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ template("aot_runner_package") {
169169
deps += [
170170
"vmservice:vmservice_snapshot",
171171
"//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_aot_runner",
172-
173-
# TODO(kaushikiska): Figure out how to get the profiler symbols for `libdart_aotruntime`
174-
# "$dart_src/runtime:libdart_aotruntime",
175-
observatory_target,
176172
]
177173
}
178174

@@ -195,10 +191,6 @@ template("aot_runner_package") {
195191
path = vmservice_snapshot
196192
dest = "vmservice_snapshot.so"
197193
},
198-
{
199-
path = rebase_path(observatory_archive_file)
200-
dest = "observatory.tar"
201-
},
202194
{
203195
path = dart_profiler_symbols
204196
dest = "dart_aot_runner.dartprofilersymbols"
@@ -222,10 +214,7 @@ template("jit_runner_package") {
222214
]
223215

224216
if (!invoker.product) {
225-
deps += [
226-
"//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_jit_runner",
227-
observatory_target,
228-
]
217+
deps += [ "//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_jit_runner" ]
229218
}
230219

231220
binary = "dart_jit${product_suffix}_runner"
@@ -247,10 +236,6 @@ template("jit_runner_package") {
247236

248237
if (!invoker.product) {
249238
resources += [
250-
{
251-
path = rebase_path(observatory_archive_file)
252-
dest = "observatory.tar"
253-
},
254239
{
255240
path = rebase_path(
256241
get_label_info(

engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_runner.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,6 @@ DartRunner::DartRunner(sys::ComponentContext* context) : context_(context) {
228228
params.shutdown_isolate = IsolateShutdownCallback;
229229
params.cleanup_group = IsolateGroupCleanupCallback;
230230
params.entropy_source = EntropySource;
231-
#if !defined(DART_PRODUCT)
232-
params.get_service_assets = GetVMServiceAssetsArchiveCallback;
233-
#endif
234231
error = Dart_Initialize(&params);
235232
if (error)
236233
FML_LOG(FATAL) << "Dart_Initialize failed: " << error;

engine/src/flutter/shell/platform/fuchsia/dart_runner/service_isolate.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,18 +197,4 @@ Dart_Isolate CreateServiceIsolate(
197197
return isolate;
198198
} // namespace dart_runner
199199

200-
Dart_Handle GetVMServiceAssetsArchiveCallback() {
201-
dart_utils::MappedResource vm_service_tar;
202-
if (!dart_utils::MappedResource::LoadFromNamespace(
203-
nullptr, "/pkg/data/observatory.tar", vm_service_tar)) {
204-
FML_LOG(ERROR) << "Failed to load Observatory assets";
205-
return nullptr;
206-
}
207-
// TODO(rmacnak): Should we avoid copying the tar? Or does the service
208-
// library not hold onto it anyway?
209-
return tonic::DartConverter<tonic::Uint8List>::ToDart(
210-
reinterpret_cast<const uint8_t*>(vm_service_tar.address()),
211-
vm_service_tar.size());
212-
}
213-
214200
} // namespace dart_runner

engine/src/flutter/shell/platform/fuchsia/dart_runner/service_isolate.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ Dart_Isolate CreateServiceIsolate(const char* uri,
1313
Dart_IsolateFlags* flags,
1414
char** error);
1515

16-
Dart_Handle GetVMServiceAssetsArchiveCallback();
17-
1816
} // namespace dart_runner
1917

2018
#endif // FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_RUNNER_SERVICE_ISOLATE_H_

engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,7 @@ template("jit_runner") {
312312
]
313313

314314
if (!product) {
315-
deps += [
316-
"//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:flutter_jit_runner",
317-
observatory_target,
318-
]
315+
deps += [ "//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:flutter_jit_runner" ]
319316
}
320317

321318
binary = "flutter_jit${product_suffix}_runner"
@@ -329,10 +326,6 @@ template("jit_runner") {
329326

330327
if (!product) {
331328
resources += [
332-
{
333-
path = rebase_path(observatory_archive_file)
334-
dest = "observatory.tar"
335-
},
336329
{
337330
path = rebase_path(
338331
get_label_info(
@@ -381,10 +374,7 @@ template("aot_runner") {
381374
deps = [ ":aot${product_suffix}" ]
382375

383376
if (!product) {
384-
deps += [
385-
"//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:flutter_aot_runner",
386-
observatory_target,
387-
]
377+
deps += [ "//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:flutter_aot_runner" ]
388378
}
389379

390380
binary = "flutter_aot${product_suffix}_runner"
@@ -398,10 +388,6 @@ template("aot_runner") {
398388

399389
if (!product) {
400390
resources += [
401-
{
402-
path = rebase_path(observatory_archive_file)
403-
dest = "observatory.tar"
404-
},
405391
{
406392
path = rebase_path(
407393
get_label_info(

engine/src/flutter/testing/dart/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ foreach(test, tests) {
7272

7373
group("dart") {
7474
testonly = true
75-
deps = [ "//flutter/testing/dart/observatory" ]
75+
deps = [ "//flutter/testing/dart/vm_service" ]
7676
foreach(test, tests) {
7777
deps += [ ":compile_$test" ]
7878
}

engine/src/flutter/testing/dart/observatory/BUILD.gn renamed to engine/src/flutter/testing/dart/vm_service/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ foreach(test, tests) {
1818
}
1919
}
2020

21-
group("observatory") {
21+
group("vm_service") {
2222
testonly = true
2323
deps = []
2424
foreach(test, tests) {
File renamed without changes.

0 commit comments

Comments
 (0)