Commit Graph

19 Commits

Author SHA1 Message Date
Ben Konyi fa9895bdf6 [VM Service] Add service info file dumping and bind address support
Adds support for writing the active VM service connection URI to the file
specified by `--write-service-info-to-file` and updates native bindings
with the web server address on startups.

TAG=agy
CONV=ae3a29f5-e2c8-499c-b221-ff61e40f5f1f

Change-Id: Ice85fda098031ef4ba1cd1120a917137aae97105
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505163
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2026-05-29 13:19:00 -07:00
Ben Konyi ad7c6453a6 [VM Service] Fix DevFS stream PUT requests
Resolves issues in DevFS handling where individual stream file PUT
requests could result in flaky test failures on Windows.

TAG=agy
CONV=ae3a29f5-e2c8-499c-b221-ff61e40f5f1f

Change-Id: I55d12cc55f35d1d1ed36742d442a3d4bebad53bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505162
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-05-29 13:18:35 -07:00
Ben Konyi 85da4dfd46 [VM Service] Fix Windows expression evaluation type crash in experimental service
Correctly define `kRootLibraryUri` constant and forward `rootLibraryUri`
to the resident frontend compiler.

TAG=agy
CONV=ae3a29f5-e2c8-499c-b221-ff61e40f5f1f

Change-Id: Ie4c87857744d9b32165ea7d0f8004d6d6c337886
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505161
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-05-29 13:18:35 -07:00
Ben Konyi 5b01408585 [VM Service] Fix Windows hot reload timeout when using experimental service
Forward the `pause` parameter to the C++ runtime in reloadSources, and use
the path resolver helper to properly resolve raw Windows file paths during
hot reload compilation.

TAG=agy
CONV=ae3a29f5-e2c8-499c-b221-ff61e40f5f1f

Change-Id: Iab29cb94b390144d17f1c014ec2e9acd1ab1e11e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505160
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2026-05-29 12:50:53 -07:00
Ben Konyi 51050481c9 [Service] Support isolate/root in package:dart_runtime_service
Adds isSystemIsolate in the isolate startup message sent to the
VM service, allowing for the service to identify the first non-system
isolate as the root isolate.

TEST=Existing tests

CoreLibraryReviewExempt: dart:vmservice is internal.
Change-Id: I0a982a1fc06bd0be0426ad9d1401e89375cbed40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500000
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2026-05-13 09:40:15 -07:00
Ben Konyi c0df8bae2e [Service] Add support for specifying bind address to dart_runtime_service_vm
Also adds a Pool to protect against race conditions around managing the
HttpServer.

TEST=Manual

Change-Id: If748b6e5beb59c0b853e16477f0dac96ffafcaf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499760
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2026-05-04 10:48:35 -07:00
Ben Konyi 0b68c62fc5 [Service] Add support for resident frontend server to package:dart_runtime_service_vm
TEST=Existing, ran locally.
Change-Id: Idc1f35eb3d4cf0c7251a64b02b801e8110cc323b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499000
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-04-30 17:04:19 -07:00
Ben Konyi 5bb13f1788 [ Service ] Cleanup dart_runtime_service* logging and DDS state
A few minor changes:

 - Log output is now written to stderr.
 - `Service.controlWebServer`'s `silenceOutput` parameter is now
   respected, along with the `SILENT_OBSERVATORY`, `SILENT_VM_SERVICE`,
   and `SILENT_SERVICE` Dart defines.
 - DDS launcher state is cleaned up if the service server is shutdown
   via SIGQUIT.

Change-Id: I0e3e271905ad6bc111151bac086fe7661c23d578
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491280
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-04-10 12:04:28 -07:00
Ben Konyi a00e7d39dc [ Service ] Fix various tests for package:dart_runtime_service_vm
- Fixes issue where `streamListen(streamId: 'foo')` didn't result in an
  error when DDS was not present.
- Adds stub for the deprecated `streamCpuSamplesWithUserTag`

Change-Id: Ic18c2b24a103347eee60ee803a873f747dbfee7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491200
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2026-04-10 12:04:28 -07:00
Ben Konyi d2d28414ef [ Service ] Add support for ID zones to package:dart_runtime_service_vm
Also disables logging by default, which can be enabled by specifying the
`VM_SERVICE_LOGGING` environment variable.

package:vm_service test suite is ~99% passing with this change.
Change-Id: I41578cc8b39afac93589b8792861be34b848f558
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490921
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2026-04-10 12:04:28 -07:00
Ben Konyi cb72e886d5 [ Service ] Add support for binary events in package:dart_runtime_service_vm
package:vm_service test suite is ~98% passing with this change.
Change-Id: I7455eb6414ac6a9f28408613543d18be7940bbb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490600
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2026-04-10 12:04:28 -07:00
Ben Konyi ae1b83869a [ Service ] Add support for DDS to package:dart_runtime_service_vm
The DartRuntimeService based VM service implementation now has support
for launching DDS instances and responding to _yieldControlToDDS RPC
invocations from DDS instances.

package:vm_service test suite is ~97% passing with this change.

TEST=Local testing.
Change-Id: I2f2f1b0926845134578f08d073ed7606f1fc4173
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490320
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2026-04-10 12:04:28 -07:00
Ben Konyi 6ea62c02fe [ Service ] Run the service's main() via _runMainIsolate
Prior to this change, the VM service isolate was configured to execute
`main` directly. This resulted in unexpected behavior around exceptions
thrown after the first asynchronous gap, which were unhandled but caused
the service isolate to exit silently with no error.

This change updates how the service isolate starts execution by
invoking `main` via `dart:isolate`'s `_runMainIsolate` method, similar
to how user isolates and the DartDev isolate start execution. This
results in the message handler being triggered, meaning the microtask
queue will be processed correctly and unhandled exceptions in
asynchronous contexts being reported.

TEST=Local testing with exceptions explicitly thrown from within the VM
service

Change-Id: I69475a86d923489fa216bc8e939a2726cf3ff2e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490220
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-03-24 11:57:40 -07:00
kevmoo 193e53076c Use ^3.12.0-0 instead of -edge
Otherwise folks on ~latest bits from Flutter can't run pub!

Resolving dependencies in `/Users/kevmoo/github/dart/sdk`...
The current Dart SDK version is 3.12.0-261.0.dev.

Because dart_runtime_service_vm requires SDK version ^3.12.0-edge, version solving failed.

Change-Id: I76af81c9f6d9360a347300a1b8bac479ee45c631
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489640
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2026-03-23 11:20:48 -07:00
Ben Konyi 086cb1a441 [ Service ] Add HTTP and DevFS support to package:dart_runtime_service
This change adds support for invoking RPCs via HTTP requests, allowing
for interacting with the service without needing to establish a web
socket connection.

This change also adds support for the development file system, otherwise
known as DevFS. DevFS is a (currently) undocumented feature provided by
the VM service that gives clients limited file system access within a
directory contained in the system's temp directory. This is currently
used by Flutter to push kernel files to the device when performing a hot
reload.

The DevFS implementation for package:dart_runtime_service_vm removes
the long deprecated support for `path` parameters, leaving `uri`s as
the only supported format for specifying file system types. Existing
DevFS tests have been updated to replace `path` with `uri` in
preparation for dart_runtime_service_vm becoming the new default VM
service.

This change brings the package:vm_service test suite pass rate to ~95%.

Change-Id: Ib7d95db5788c37408d3dec79926ca7206660a43f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488280
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-03-20 15:23:38 -07:00
Ben Konyi 0e9d801353 [ Service ] Fix dart:developer service extensions, add getSupportedProtocols
Brings package:vm_service test suite pass rate up to ~93%

Change-Id: I108a24e1acf37eb69c9de25a2f7334eb4c56dbe6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487600
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-03-16 11:14:58 -07:00
Ben Konyi e3ca6d824b [ Service ] Add expression evaluation support to dart_runtime_service_vm
Brings pass rate of package:vm_service tests to ~85%

TEST=Manual
Change-Id: I2335d98358362110add93c2acfe51c3fc1385237
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487560
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-03-16 11:14:52 -07:00
Ben Konyi a8aba7fab8 [ Service ] Add support for isolate-based RPCs to dart_runtime_service_vm
This change adds initial support for working with isolates in the Dart
Runtime Service and its backends.

The new `IsolateManager` base class tracks the set of active isolates
and their lifecycle events. The `VmIsolateManager` extends this class,
adding support specific to interacting with isolates within the Dart VM.

TEST=vm/cc/DartAPI_InvokeVMServiceMethod*_Exp

Change-Id: I3dfa298722c40dbdfdd58105cc78f31d058dd7a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486560
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2026-03-12 09:08:14 -07:00
Ben Konyi f7a049dfb4 [ Service ] Initial implementation of VM Service based on package:dart_runtime_service
This change includes an initial implementation of the new VM service
implementation based on `package:dart_runtime_service`, along with the
necessary plumbing to start it in place of the legacy VM service
implementation.

The entrypoint for the new VM service implementation is located in
dart_runtime_service_vm/bin/vm_service_entrypoint.dart, which is
compiled into AppJIT and AOT snapshots when the
`--include-experimental-vm-service` flag is provided to `build.py`. To run
the VM with the new VM service implementation, the
`--experimental-vm-service` flag must be provided.

Currently, the experimental VM service implementation supports:

  - User specified ports
  - Authentication code flags
  - Enabling the HTTP server via SIGQUIT
  - Some service protocol RPCs that don't require an isolate ID (e.g.,
    `getVM`)

See go/dart-runtime-services-unification for more details.

TEST=Manual

CoreLibraryReviewExempt: dart:_vmservice is private
Change-Id: I4a58cd1fa0a386313baa3d5c5345720231279123
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484820
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-03-10 13:27:01 -07:00