Commit graph

241 commits

Author SHA1 Message Date
Danny Tuppeny df67dc892b [dds] Add some basic test reporting for DAP test adapter
Change-Id: I39ca29ee5809fd0d6ef30ee163298f66749bed0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215080
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-10-01 16:31:34 +00:00
Ben Konyi b8533e6b09 [ package:dds ] Fix issue where cancelling multiple streams with the same name would throw a StateError
Fixes https://github.com/flutter/devtools/issues/3302

TEST=test/regress_devtools_issue_3302_test.dart

Change-Id: Ica0665c8a48cdb881ecdf7e3985660513c4b98b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214662
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-27 16:35:53 +00:00
Danny Tuppeny 4389cf7bba [dds] Add support for services/service extensions to DAP
Change-Id: I4f63fd60bf2128c8e88c999c0963b8a1e5304178
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214281
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-24 11:53:15 +00:00
Danny Tuppeny b68ccc9a39 [dartdev] Add a "dart debug_adapter" command to run the DAP server from DDS
Change-Id: Icf4442929f848f7f927e84c999f09206e3fd0704
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213640
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-17 16:09:49 +00:00
Danny Tuppeny 35d5f857ab [dds] Add a DAP debug adapter that runs "dart test" and passes package:test JSON back
Change-Id: I2619df1d514529457a2035f40eecc5b33f52abd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212576
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-15 15:11:25 +00:00
Ahmed Ashour d6975c1905 master branch to main
Fixes #47190

TEST=None, only markdown files where edited.

Change-Id: Ife204f9c792b6bce30d0cd7bf2260ced11c8f2b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213049
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-09-15 06:22:23 +00:00
Lasse R.H. Nielsen f7e4886ad2 Make dds package not use ?. for a static call.
This should have been a warning since null safety
(or arguably since 2.0), but analyzer and compilers
didn't display the warning.

Prepare the package for such usage now being enforced and a warning
or even an error.

Change-Id: I73a852b88dabcaa1396aeec08f33856668e31fe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212830
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-09-09 15:24:01 +00:00
Danny Tuppeny e161187728 [dds] Refactor some DAP classes in preperation for "dart test" adapter
Change-Id: Ice48b45c0ad11a1981e8e4115bb8de6d009d7b5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212062
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-07 14:03:03 +00:00
Ben Konyi 3ff52042ea [ package:dds ] Silently handle exceptions raised within RPC request
handlers

Fixes https://github.com/flutter/flutter/issues/84113

Change-Id: I416308845c5c7f9a1bb547b6429f1e9d49393583
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212268
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-01 23:16:07 +00:00
Ben Konyi 492d061332 [ package:dds ] Add missing RPCs and responses to DDS protocol
Change-Id: I884c62e2be4159bc588ffa1bba3d8695b0cef3f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208300
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-09-01 22:31:37 +00:00
Danny Tuppeny 2d8764a557 [dds] Don't automatically resume when attaching to processes via DAP
Change-Id: I8b0fd4b36a9dd229226046a74e031de005908417
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210920
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-25 16:37:52 +00:00
Danny Tuppeny eff9280e55 [dds] Add support for vmServiceInfoFile to DAP attachRequest
Change-Id: Ibc3e4aef140cb2a2b061bb91b0328230ca70053d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210861
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-25 00:47:34 +00:00
Ben Konyi c7fe9ada2f Reland "[ package:dds ] Add support for caching CPU samples based on UserTag"
This reverts commit ada4278fd5.

TEST=pkg/dds/test/get_cached_cpu_samples_test.dart

Change-Id: I771410c8647fc1eb721c5aeb325c7a595430435c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209120
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-08-25 00:04:04 +00:00
Danny Tuppeny 63f1fb02a4 [dds] Support attachRequest in Dart CLI DAP
Change-Id: I4bcd7483ab9f3ed8dd839bd69b59d21f8139c582
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210724
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-23 23:22:48 +00:00
Danny Tuppeny 30a3b9c716 [dds] Improve error handling of calling getters + toString() display in DAP variables
Change-Id: I5b93667925a7f4a6da9edd8f5c94e56b1dbff6d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209963
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-18 21:07:04 +00:00
Danny Tuppeny 7a4fbdf88f [dds] Support logging VM Service traffic to the client from DAP
Change-Id: Id9f6b2158dcf1603468b989ed2f900b390b9b259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209546
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-18 20:55:53 +00:00
Danny Tuppeny 52e94d1bbb [dds] Improve DAP evaluation errors for Watch window
+ allow trailing semicolons in evaluation expressions.

Change-Id: Id7b7305ecaf7035ae445100a5f1e6d7010301067
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209960
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-18 20:55:23 +00:00
Devon Carew 3365b77ac2 use code from package:devtools_shared
Change-Id: Ie16400c7c216fb165fb5c65a0150e37b5512ef69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210161
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-08-13 21:54:01 +00:00
Danny Tuppeny c010c1d54f [dds] Add support for showing Maps in variablesRequests for DAP
Change-Id: I92379f4f9d300d2cdbd209bb77259acdcad7a089
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209914
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-08-12 20:27:30 +00:00
Danny Tuppeny 57e41b122e [dds] Include evaluateNames in returned variables
Change-Id: I26173d7b618baf431a9fa01d6e8461800427b015
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209912
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-12 20:27:30 +00:00
Danny Tuppeny 659464ac3c [dds] Add support for Log Points to DAP
Change-Id: I74dca1871d3c6b826aafecbb6425604d43b9262f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209704
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-12 00:32:27 +00:00
Ben Konyi 83283a553e [ package:dds ] Prevent invalid DDS instance from being returned after
shutdown during initialization

Subtle event queue execution ordering could result in an invalid DDS
instance being returned with the HTTP server instance not yet being
initialized. Calling shutdown() on this instance would cause a
LateInitializationError when trying to cleanup the server.

Fixes https://github.com/flutter/flutter/issues/86361

Change-Id: Idf1f271925d244811af4b61b3161ddcbc05c52eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209846
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-11 23:36:27 +00:00
Danny Tuppeny 5447c3981e [dds] Add support for conditional breakpoints in DAP
Change-Id: I5f28337b0371f4efb52b2ba169bf27e1d61425c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209702
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-10 19:33:20 +00:00
Danny Tuppeny 215efd6642 [dds] Mark not-debuggable frames as deemphasized in DAP
This allows user code to stand out better in the stack trace when debugging SDK/External packages is disabled.

Change-Id: I1740001f2aa085e3bc2069d788e1c53e71386866
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209641
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-10 16:54:23 +00:00
Danny Tuppeny de5986ef24 [dds] Add tests for DAP exception behaviour
Change-Id: I524a7bdebd0c4f572db67550cd42f4ba5118cfc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209640
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-09 22:44:09 +00:00
Danny Tuppeny 3d3a48ff9a [dds] Add support for DAP sourceRequest to download source from the VM
Change-Id: Icb639c7008d51d6ffbecb95e362cc07c81993424
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209103
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-09 16:48:08 +00:00
Danny Tuppeny 9e928c8587 [dds] Handle DAP debug termination more reliably based on whether there's an active process
Change-Id: I8a14074f242dd0719624d610fa6d1768ecb4d152
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209545
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-09 16:01:29 +00:00
Ivan Inozemtsev dee7d252d4 Inline non-functional type alias
Reason: b/195648511, non-functional type aliases are not supported by
some internal infra
Change-Id: I1c164f4ecf23ac22a36cabc630bf7e8f762d4849
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209541
Reviewed-by: Michal Terepeta <michalt@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2021-08-09 10:26:28 +00:00
Ben Konyi 4d4f69ab95 Reland "[ package:dds ] Add locking when modifying DDS state via client requests"
This reverts commit 0b0bb9940d.

Fixes https://github.com/dart-lang/sdk/issues/46826

TEST=dds/test/regress_45569_test.dart and service_2/break_on_function_many_child_isolates_test/dds

Change-Id: I84ac047adb7b20a5392744993b22895bffacce9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209262
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2021-08-07 15:16:49 +00:00
Danny Tuppeny a6176ec3dd [dds] Support delegating running the debugee to the editor in DAP using runInTerminal
Change-Id: I9fd435ee43ca9ae0d1e38bdffd9121157d33b730
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208654
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-06 16:42:17 +00:00
Ben Konyi 0b0bb9940d Revert "[ package:dds ] Add locking when modifying DDS state via client requests"
This reverts commit 0ecfc7da6f.

Reason for revert: https://github.com/dart-lang/sdk/issues/46826

Original change's description:
> [ package:dds ] Add locking when modifying DDS state via client requests
>
> Fixes https://github.com/dart-lang/sdk/issues/46696
>
> Change-Id: I666b59a0661f4df3b1f0a47aba52096133f5fbb7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209140
> Reviewed-by: Anna Gringauze <annagrin@google.com>

TBR=bkonyi@google.com,annagrin@google.com

Change-Id: Iec89181372a2fc1b8a461e616bbcd23dd6bbd72d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209280
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-05 21:32:42 +00:00
Ben Konyi 0ecfc7da6f [ package:dds ] Add locking when modifying DDS state via client requests
Fixes https://github.com/dart-lang/sdk/issues/46696

Change-Id: I666b59a0661f4df3b1f0a47aba52096133f5fbb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209140
Reviewed-by: Anna Gringauze <annagrin@google.com>
2021-08-05 17:56:01 +00:00
Ben Konyi ada4278fd5 Revert "Reland "[ package:dds ] Add support for caching CPU samples based on UserTag""
This reverts commit 1796160606.

Reason for revert: Still seeing failures.

Original change's description:
> Reland "[ package:dds ] Add support for caching CPU samples based on UserTag"
>
> This reverts commit 4160747ef6.
>
> It seems like 9397b8ff05 should have fixed the original failures we were seeing and the failing bots in question seem to be passing when running try jobs.
>
> TBR=asiva@ (discussed offline)
>
> TEST=Existing service tests + get_cached_cpu_samples_test
> Change-Id: I1c50c0e79375df819a0bd68e68ac28c3064874c8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208441
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,asiva@google.com

Change-Id: Ic522ab61b430673533c94ecd0c91bee569a0add6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208960
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-04 17:32:38 +00:00
Ben Konyi 1796160606 Reland "[ package:dds ] Add support for caching CPU samples based on UserTag"
This reverts commit 4160747ef6.

It seems like 9397b8ff05 should have fixed the original failures we were seeing and the failing bots in question seem to be passing when running try jobs.

TBR=asiva@ (discussed offline)

TEST=Existing service tests + get_cached_cpu_samples_test
Change-Id: I1c50c0e79375df819a0bd68e68ac28c3064874c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208441
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-03 19:18:59 +00:00
Danny Tuppeny 874f1db1f9 [dds] Support debugging "just my code" in DAP using 'debugExternalPackageLibraries=false'
Change-Id: I82556df94722b72240383f57524a5692d176ca11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208646
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-08-03 14:38:49 +00:00
Alexander Markov 4160747ef6 Revert "[ package:dds ] Add support for caching CPU samples based on UserTag"
This reverts commits 746b8f1f5c and
9ee2259fde.

Reason for revert: https://github.com/dart-lang/sdk/issues/46746

Original change's description:
> [ package:dds ] Add support for caching CPU samples based on UserTag
>
> DDS can be configured to listen for CPU sample events and cache samples
> that were collected while certain UserTags are active. These cached
> samples are stored in a ring buffer and are stored until the isolate
> shuts down.
>
> TEST=pkg/dds/test/get_cached_cpu_samples_test.dart
>
> Change-Id: Ib20770f59f1672c703413486f87795b3bb23f676
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207206
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>

TEST=ci
TBR=bkonyi@google.com,rmacnak@google.com,kenzieschmoll@google.com

Change-Id: I1b6655ad7e3b10e1145ff545cc90ecf3bc6e092d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208341
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-07-28 18:00:25 +00:00
Ben Konyi 746b8f1f5c [ package:dds ] Add support for caching CPU samples based on UserTag
DDS can be configured to listen for CPU sample events and cache samples
that were collected while certain UserTags are active. These cached
samples are stored in a ring buffer and are stored until the isolate
shuts down.

TEST=pkg/dds/test/get_cached_cpu_samples_test.dart

Change-Id: Ib20770f59f1672c703413486f87795b3bb23f676
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207206
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
2021-07-28 00:33:33 +00:00
Danny Tuppeny 248e943b97 [dds] Expand truncated strings from dart:developer log() calls in DAP output
Change-Id: I31338b00daff33a5428e4b2229273ee8289f1c5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206540
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-07-22 14:38:21 +00:00
Danny Tuppeny 33c3cfc28a [dds] Support changing DAP debug settings after the session has started
Change-Id: I287457296408ae49950cef501780054260b57566
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205540
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-07-22 14:38:21 +00:00
Danny Tuppeny 6b4fc2670c [dds] Switch DAP server mode to directly using stdin/stdout
Change-Id: Id2a8d8c9274b96cf32788e11d4452954a4f9c091
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205500
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-07-22 14:38:21 +00:00
Ben Konyi a99b92c252 [ package:dds ] Avoid races while handling errors during startup
Avoids a LateInitializationError that could occur when the VM service
connection goes down during DDS startup. Done by delaying error
reporting until after DDS has completed its initial startup flow,
ensuring that all relevant state has already been initialized when we
try to cleanup.

Fixes https://github.com/flutter/flutter/issues/86361

Change-Id: I2b357bfb95c759d301ab48bce9fe1c28871d5e08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206672
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2021-07-14 23:51:46 +00:00
Devon Carew 0512b876b3 replace copied code with references to package:devtools_shared
Change-Id: I6707f593f643fbf1323f4f24bc76a76f66ed7ec5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205344
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-07-12 17:55:04 +00:00
Danny Tuppeny 8f01499793 [dds] Support IPv6 for DAP with --ipv6 flag
Change-Id: I07c66b79e832f200bf5f27c20930e1ba6a2ebda7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205261
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-07-02 00:04:52 +00:00
Danny Tuppeny c84c21e741 [dds] Support using port=0 for DAP and print the bound host/port in JSON to stdout
Change-Id: Ib1e99f1004b59cba6fa6970dbddbf5cbe87a8b32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205160
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-28 19:58:32 +00:00
Ben Konyi 0d61348584 [ CLI ] Fix IPv6 VM service support for standalone VM
The CLI was not providing the ipv6 flag to DDS, resulting in a "Could
not start Observatory" error.

Change-Id: Idff0f525455f121b8f1e89bc4ad20a01cd1165ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204860
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-24 19:50:59 +00:00
Danny Tuppeny 06fc5c522e [dds] Spawn DDS in-process with DAP
+ Switch to package:args CommandRunner
+ Add switches to enable/disable DDS/auth tokens
+ Improve verbose logging for debugging tests
+ Fix a race condition in initial unpausing of Isolates

Change-Id: I7f7ee0ef798e198ee07c1c663bce3edb0b5c7fc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204143
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-24 18:07:49 +00:00
Danny Tuppeny 1563d3fdd3 [dds] Add support for DAP threadsRequest
Change-Id: I8dc128f0fc4dae16c53bc9deaf3b866d7198110f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203902
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-21 20:44:40 +00:00
Danny Tuppeny 97f013773c [dds] Support custom requests in DAP and verify DDS is available
Change-Id: I41be607668feaab30ae10b4fe725ad3f89e4a8ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203861
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-21 20:40:20 +00:00
Danny Tuppeny 7a73faa0a2 [dds] Use different port numbers for DAP integration tests
Bots are failing with:

SocketException: Failed to create server socket (OS Error: Address already in use, errno = 48), address = localhost, port = 9200

This could be multiple test libraries being run in parallel and starting from the same port.

Change-Id: Ic7d14c3bb9a4e19295849933fadd6ad6daaea464
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203500
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-14 18:41:13 +00:00
Danny Tuppeny d5e92e1c7a [dds] Add expression eval support to DAP
Change-Id: I0c55b4dde12d40467f8243e4b0c0ccc882eb045d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203243
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-13 19:10:42 +00:00
Danny Tuppeny 4ce805bfa7 [dds] Add DAP support for Scopes/Variables
Change-Id: Idaaa08693824c389ebc83bd5f7e29d61d70cbb84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202700
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-12 23:52:41 +00:00
Danny Tuppeny 6ebcabaaf2 [dds] Add support for breakpoints and stepping to DAP
Change-Id: Iebd2c5630f826effac56ece3b4ffb3252b9ac556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201834
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-11 17:51:01 +00:00
Danny Tuppeny 48a67a24f5 [dds] Improve error logging if DAP tests fail to connect
+ re-enable tests

Change-Id: I0262db03ee0df9714d2086dc40265bea2962ee5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202760
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-07 20:52:13 +00:00
Danny Tuppeny cfd5cf3cd6 [dds] Skip DAP tests
These tests appear to be consistently failing on some bots but the code they're testing is not currently in-use. These tests will be fixed and re-enabled before the code becomes used.

Change-Id: I235c8390381c0f82d4f60078e969d5c035ee2e94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202740
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-06-07 16:09:25 +00:00
Ben Konyi ffecb6d44c [ package:dds ] Update to package:vm_service ^7.0.0
Change-Id: I3a504f3006fccd1b86356380c07f6641bf1b27ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202305
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
2021-06-03 18:28:10 +00:00
Danny Tuppeny a50c12093e [dds] Support running scripts with DAP in debug mode
This starts the app paused, connects t the VM service and resumes. It handles dart:developer log() events, but no other debugging functionality yet (for ex. breakpoints, stepping).

Change-Id: Ib50680c775da5d13df95771eec62e77a4af75a08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201566
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-02 18:28:55 +00:00
Danny Tuppeny 0374c8f720 [dds] Add support for running DAP integration tests with an out-of-process server
Change-Id: Iffa9154951a6e5e4dc1fad783f8710dad5f1a5a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201563
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-02 18:17:13 +00:00
Danny Tuppeny f9b6901baf [dds] Add a basic DAP server that can run simple Dart scripts
Change-Id: I0f10b81b0b9ad3875727f606dd1a5a44798486b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-05-26 17:22:00 +00:00
Ben Konyi 7250fd6379 Reland "[ package:dds ] Add null safety support"
This reverts commit b8c5ecd5aa.

TEST=N/A

Change-Id: I38bbebe1e38bc9dbfdde764eff847aafb3e39353
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200926
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-24 16:59:23 +00:00
Danny Tuppeny 9f9157762a [dds] Add code generator for DAP spec classes
Change-Id: I0b7a9ffd55fe249bd2997e003d3ab787f45df7ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200872
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-21 15:44:22 +00:00
Emmanuel Pellereau b8c5ecd5aa Revert "[ package:dds ] Add null safety support"
This reverts commit a527411e51.

Reason for revert: depends on package 'devtools_shared' that is not yet migrated.

Original change's description:
> [ package:dds ] Add null safety support
>
> Fixes https://github.com/dart-lang/sdk/issues/45756
>
> TEST=service + DDS tests
>
> Change-Id: I6dd14d7f9fdee479a830c3b053dc3b00aa635202
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199800
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Devon Carew <devoncarew@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Icdaef3ac55d7ef302acd3f9c2538a41e52e4253a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200180
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2021-05-17 08:12:20 +00:00
Ben Konyi a527411e51 [ package:dds ] Add null safety support
Fixes https://github.com/dart-lang/sdk/issues/45756

TEST=service + DDS tests

Change-Id: I6dd14d7f9fdee479a830c3b053dc3b00aa635202
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199800
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2021-05-14 15:47:38 +00:00
Ben Konyi bd50c47824 [ package:dds ] Prep for 1.8.0 release
Change-Id: I2e6a1ebdd752f3cee2ffa38a99e84e56296da7d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199562
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-05-12 22:31:01 +00:00
Ben Konyi b99466d472 Reland "[ VM / DDS / CLI ] Add DevTools support to the standalone VM"
This reverts commit 5cbf10febe.

TEST=pkg/dds/devtools_observatory_connection_test.dart

Change-Id: I682d009f784b930094dae9b7d4e9a66efffb6ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198561
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-11 17:55:26 +00:00
Ben Konyi 5cbf10febe Revert "[ VM / DDS / CLI ] Add DevTools support to the standalone VM"
This reverts commit ef0e4ea107.

Reason for revert: Flutter HHH and golem builds are red. Rolls to Flutter are failing.

TEST=N/A

Original change's description:
> [ VM / DDS / CLI ] Add DevTools support to the standalone VM
>
> Example output on stdout when DevTools is enabled:
>
> Observatory listening on http://127.0.0.1:8181/CzkZzZaONW4=/
> The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FCzkZzZaONW4%3D%2Fws
> hello world!
>
> vm-service: isolate(1674461414267555)  'main' has no debugger attached and is paused at exit.  Connect to Observatory at http://127.0.0.1:8181/CzkZzZaONW4=/ to debug.
>
> TEST=pkg/dartdev/test/commands/run_test.dart
>
> Change-Id: Icd1afda87ad4a46f228125d53094d10adf8056ec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188361
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I50e8dc4e592e13b44c2fb980b2029d5c5cc3ad2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198381
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-05-05 20:31:07 +00:00
Ben Konyi f55ba03aa0 [ DDS ] Handle Windows URIs when launching DevTools
Change-Id: I1d6e9de1cce32f63be6147025047b3e5897c8408
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197860
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-05-03 22:59:26 +00:00
Ben Konyi ef0e4ea107 [ VM / DDS / CLI ] Add DevTools support to the standalone VM
Example output on stdout when DevTools is enabled:

Observatory listening on http://127.0.0.1:8181/CzkZzZaONW4=/
The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FCzkZzZaONW4%3D%2Fws
hello world!

vm-service: isolate(1674461414267555)  'main' has no debugger attached and is paused at exit.  Connect to Observatory at http://127.0.0.1:8181/CzkZzZaONW4=/ to debug.

TEST=pkg/dartdev/test/commands/run_test.dart

Change-Id: Icd1afda87ad4a46f228125d53094d10adf8056ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188361
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-03 18:24:09 +00:00
Ben Konyi 14554239bf [ package:dds ] Fix issue where streamListen could be sent multiple
times to the VM service for the same stream

Fixes https://github.com/dart-lang/sdk/issues/45569

Change-Id: I8742363b54fd5c8c07331636150af8e68c11b832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196224
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-04-21 17:25:30 +00:00
Franklin Yow 03101c0c2b Update LICENSE
Changes to comply to internal review

Closes https://github.com/dart-lang/sdk/pull/45568
https://github.com/dart-lang/sdk/pull/45568

TEST=CL contains no code changes.

No-Try: true
GitOrigin-RevId: 65796784e5fdfddaa021b5c55ad435b1db419700
Change-Id: I085a948f16dc9a0de128ed0bd456ae69adf6c124
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193888
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-04-07 10:28:38 +00:00
Ben Konyi 96cf91bea3 [ package:dds ] Update DDS dependencies and set SDK requirement to >=2.12
Also updated non-migrated libraries to include @dart=2.10.

Change-Id: Idcf4e54f9aa37b9b016133144af594cc932418a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192122
Reviewed-by: Gary Roumanis <grouma@google.com>
2021-03-19 19:49:08 +00:00
Nate Bosch 7b4263c2b3 Update to the latest package:sse
Change-Id: I8f2f25a72f459fbea4fdd9bf4e81a7d6f5704a50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183182
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
2021-02-05 20:57:38 +00:00
Ben Konyi 61b80d1b39 [ package:dds ] Add 30 second keep alive period for SSE connections
Uberproxy actively kills long standing connections after a set period of
time. This change adds a 30 second keep alive period for SSE connections
so connections can be reestablished after being killed by Uberproxy
without DDS assuming the connection has disappeared.

Change-Id: I18363da475bc5d785f85f5ffbec4102a2b7941af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183141
Reviewed-by: Gary Roumanis <grouma@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-02-05 19:31:58 +00:00
Ben Konyi 6349ce0436 [ DDS ] Update package:vm_service dep to 6.0.1-nullsafety.0
Change-Id: I34c9d9f542fd896af742fd246c7111029c44daec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180606
Reviewed-by: Dan Field <dnfield@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-22 22:03:07 +00:00
Ben Konyi a7c9e24aef [ package:dds ] Return a RpcException error with kServiceDisappeared
code if DDS loses connection to the VM service while forwarding a
request.

Change-Id: I9bb2adc160f25658756cc7106b77cbcd3b9ccc27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180090
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-20 00:01:55 +00:00
Ben Konyi 6de68d541a [ package:dds ] Fix issue where handling a StateError due to a VM
service connection loss could result in a null JSON RPC response.

This would cause package:vm_service to throw a NoSuchMethodError as it
currently assumes it will never receive a null result in a JSON RPC
response.

Related to https://github.com/flutter/flutter/issues/74051.

Change-Id: I86c1c9f7e46e34519f32dfed589c6b31aed39d7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179800
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-17 23:08:18 +00:00
Ben Konyi ef7e0810f2 [ package:dds ] Fix instance where DartDevelopmentServiceException could
have a null message

Change-Id: I03e800aeef82ce536e768b8da6ba274d89486bb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179367
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-15 01:42:40 +00:00
Ben Konyi 613ab14a9a [ package:dds ] Disable package:test timeout for sse_smoke_test
Fixes https://github.com/dart-lang/sdk/issues/44474

Fixed: 44474
Change-Id: I62e6847f2e6c14deee16c3676e5e18616baa4ad4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176780
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-13 21:06:03 +00:00
Ben Konyi d9ca0514bc [ Service ] Disconnect existing clients when DDS calls
_yieldControlToDDS

Instead of DDS failing to connect when there are existing clients
connected to the VM service, the VM service will now disconnect these
clients when _yieldControlToDDS is invoked.

If an existing DDS instance is already connected, existing clients will *not*
be disconnected and instead an error will be returned containing the URI of
the existing DDS instance.

TEST= runtime/observatory/tests/service/dds_disconnects_existing_clients_test.dart

Change-Id: I08e126d99f51ff14205f359a60ca802c27fd206d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178725
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2021-01-12 02:05:00 +00:00
Ben Konyi fb5ffc8275 [ package:vm_service] Output null-safe code from package:vm_service code generator
TEST=Existing VM service tests

Change-Id: Ia3877927f8c761c8f37a37f1efe87221cc1ac2aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156980
Reviewed-by: Gary Roumanis <grouma@google.com>
2021-01-08 21:19:38 +00:00
Ben Konyi 800ec511f5 [ DDS ] Add extension methods and getters for streams including event history
Also fixes issue where `StreamHistory` events were not being parsed
correctly.

Fixes https://github.com/dart-lang/sdk/issues/44505

Change-Id: I36c3bccf229a02ea78168041a112a30046773d59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177720
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-07 17:04:38 +00:00
Ben Konyi 34b4c914a4 [ DDS ] Add getStreamHistory RPC and package:vm_service extensions
Adds a DDS RPC which allows for stream history to be manually requested
in addition to being sent upon initial stream subscription.

Also adds an initial implementation of
package:dds/vm_service_extensions.dart, which adds DDS functionality to
the `VmService` class.

Fixes https://github.com/dart-lang/sdk/issues/44505

Change-Id: I198a6fd7fca15f131a6fdd95e7860a6f98ef06a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177182
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-12-30 02:30:15 +00:00
Devon Carew 13b1af4c2e [pkg/dds] refactor parts into private libraries
Change-Id: Ic104627b676119742606f7b34b025c6f0d093db0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176600
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-12-29 00:59:24 +00:00
Ben Konyi 22f82bce92 [ package:dds ] Regenerate sse_smoke_driver.dart.js
There was a syntax error in the generated code preventing the test from
completing.

Fixes https://github.com/dart-lang/sdk/issues/44474

Change-Id: Ifacfa0d9d3587ebfa52870372a35c1c2dbff4784
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176940
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-12-22 19:47:11 +00:00
Lasse R.H. Nielsen 6e29700e16 Update List constructor documentation, deprecate constructor.
Emphasize that the operation is going away,
and mark constructor as deprecated.

TEST= Refactoring+deprecation only, covered by existing tests.

Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-07 16:20:28 +00:00
Ben Konyi fc892d7fca [ package:dds ] Handle StateError when VM service disappears
Fixes https://github.com/flutter/flutter/issues/70579

Change-Id: Ic32acaa038afcf67c98b77d20fd39d136bec13b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175163
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
2020-12-05 01:19:12 +00:00
Ben Konyi a157ddbf94 [ DDS ] Add errorCode to DartDevelopmentServiceException to better
communicate reason for error

Change-Id: I5041558ad6370f873dc23515fdad1ec8a2cf4ba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172880
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-18 23:45:41 +00:00
Ben Konyi c36ba8b50c [ package:dds ] Improve DDS error handling, add tests
Added tests to try and emulate failures reported in flutter_tools crash
reports. Used these tests to update error handling and get a better
understanding of exception scenarios.

Change-Id: Ie72822dafcc6373ebfeea543d93b934c0d0687f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172420
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-17 00:00:45 +00:00
Ben Konyi d2775733a6 Reland "[ DDS ] Keep event history for Stdout, Stderr, and Extension streams"
This reverts commit a486752050.

Change-Id: I112a907792b5cbfd4a1ee0eb96898dc931c92f23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170480
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-06 19:02:23 +00:00
Ben Konyi a486752050 Revert "[ DDS ] Keep event history for Stdout, Stderr, and Extension streams"
This reverts commit 892cc93f26.

Reason for revert: Causing assertion failures on pkg-linux-debug

Original change's description:
> [ DDS ] Keep event history for Stdout, Stderr, and Extension streams
>
> Change-Id: I14ce732cd408ece1da2801887cac3b518bc36af6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169146
> Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,kenzieschmoll@google.com

Change-Id: Idf2a5f07433af0772ef36aaa2ba7b24b1a5e0323
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170300
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-04 00:25:37 +00:00
Ben Konyi 892cc93f26 [ DDS ] Keep event history for Stdout, Stderr, and Extension streams
Change-Id: I14ce732cd408ece1da2801887cac3b518bc36af6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169146
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-03 19:09:47 +00:00
Ben Konyi fafc1bdb85 [ VM Service / DDS ] Forward 'evaluate' and 'evaluateInFrame' requests to VM Service
Changes DDS from invoking the VM's private compilation RPCs directly
when an external compilation service is not present. This resulted in
expression evaluation failing when the VM Service implementation was
DWDS.

Change-Id: I889774f0f2e133307f490b586a68ebe609096b49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165680
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-10-01 19:00:20 +00:00
Ben Konyi 154e885bd4 [ package:dds ] Cleanup error handling for early shutdown cases
Fixes situation where confusing errors were thrown when DDS was shut
down while starting up (e.g., StateError from in-flight requests,
WebSocket exceptions due to the VM service disappearing, etc).

Change-Id: I8293eaf4a176d9258fc2c794d595dc926711f31a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164601
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-28 16:46:56 +00:00
Ben Konyi fe85812e27 [ VM / DartDev ] Fix --disable-service-auth-codes not being recognized by DDS
The VM and dartdev were not forwarding --disable-service-auth-codes to
the DDS instance, resulting in auth codes always being enabled.

Change-Id: Ib23bfeb7c64a51fb1229f049a4b61cb1ce5018de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163261
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-09-18 17:23:31 +00:00
Ben Konyi b5f688e938 [ package:dds ] Send ServiceRegistered events on Service stream subscription
The VM service sends ServiceRegistered events for each registered
service to each client when they first subscribe to the Service stream.
DDS was not mimicking this behavior correctly.

Change-Id: I5e49796200bfff37b8bfc210cbbf714f4a7a43d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163263
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-17 18:58:23 +00:00
Ben Konyi 437eeb778e [ package:dds ] Don't assume isolateIds take form of 'isolates/123'
DWDS doesn't use the `isolates/$id` scheme for its isolate IDs which was
causing an exception to be thrown when resuming an isolate.

Change-Id: Id1b81895ea942da8bcb4c10edb83128469e2793c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162941
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-15 17:20:01 +00:00
Ben Konyi 1c21e4763a [ package:dds ] Fix sseUri not returning a URI with a 'sse' scheme
Change-Id: I323f6a4bec959b63c5dbd95b577cc22c79c8548a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162061
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-09-10 16:44:10 +00:00
Devon Carew 70eb699641 change the java impl of the vm service protocol library to support new major protocol versions
Change-Id: I0a954cbcf1103f999575f7d923037ae342f4256c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162140
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-09-09 16:04:09 +00:00
Ben Konyi b782d09afd Reland "[ package:dds ] Add IPv6 support; 1.3.2 release"
This reverts commit c9182ad3c0.

Change-Id: I5e00c7f5138fbff0e54aab599a2548fa1f3146ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161561
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-03 20:21:07 +00:00
Ben Konyi f0d88cc96d Reland "[ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0"
This reverts commit ed120c3c80.

Change-Id: I445f4bb2dafaad3ce2daa3ae42efe1723f9b1abe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160660
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-03 15:20:14 +00:00
Ben Konyi c9182ad3c0 Revert "[ package:dds ] Add IPv6 support; 1.3.2 release"
This reverts commit 23f80fb7fd.

Reason for revert: https://github.com/dart-lang/sdk/issues/43292

Original change's description:
> [ package:dds ] Add IPv6 support; 1.3.2 release
> 
> Change-Id: I62ca85c2340d8c91fd2f08c945bf981ac36adad3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161400
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I30f1485ef573d5f2f9c7bebcfc3ef800e344fac1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161450
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-09-02 02:56:24 +00:00
Ben Konyi 23f80fb7fd [ package:dds ] Add IPv6 support; 1.3.2 release
Change-Id: I62ca85c2340d8c91fd2f08c945bf981ac36adad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161400
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-01 23:36:41 +00:00
Ben Konyi ed120c3c80 Revert "[ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0"
This reverts commit 0ea18ffb36.

Reason for revert: Tree is on fire

Original change's description:
> [ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0
> 
> This change does the following:
>   - The DDS URI will be reported by the VM as the VM service URI. If DDS
>     disconnects, the VM service URI will be reported instead. This only
>     impacts the standalone VM.
>   - Updated the service protocol to 4.0 and removed the following
>     deprecated functionality:
>       - Client synchronization RPCs (these now live in DDS)
>       - getWebSocketTarget (no longer needed as the VM service no longer
>         tries to redirect web socket clients to DDS)
>   - Regenerates package:vm_service based on the new spec, prepare for
>     5.0 release
> 
> Change-Id: I8a2b401062342eb99b81ef10ef6926baa88f946e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160141
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: I6a16e9fa7ceb18555d6424a169cfa811d3833419
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160340
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-26 16:08:27 +00:00
Ben Konyi 0ea18ffb36 [ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0
This change does the following:
  - The DDS URI will be reported by the VM as the VM service URI. If DDS
    disconnects, the VM service URI will be reported instead. This only
    impacts the standalone VM.
  - Updated the service protocol to 4.0 and removed the following
    deprecated functionality:
      - Client synchronization RPCs (these now live in DDS)
      - getWebSocketTarget (no longer needed as the VM service no longer
        tries to redirect web socket clients to DDS)
  - Regenerates package:vm_service based on the new spec, prepare for
    5.0 release

Change-Id: I8a2b401062342eb99b81ef10ef6926baa88f946e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160141
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-08-26 14:55:15 +00:00
Devon Carew 8a0b75ced1 update the pubspec files to reflect actual package usage
Change-Id: I1fa259d0a9e827c7491312ce2e5ffe8261147038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159142
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-08-19 19:40:47 +00:00
Nate Bosch 3b6aeb43fa Handle StateError for closed serviceClient
In https://github.com/dart-lang/json_rpc_2/pull/52 the `Peer` class was
fixed to behave like a `Client` when the connection is closed with
outstanding requests.

`package:dds` was previously relying on having the futures never
complete to send the `serviceDisappeared` code when the client was
closed with outstanding requests. Check also for the `StateError` that
would result from outstanding requests and translate them to
`serviceDisappeared`.

Change-Id: I2d3f186d1d52d34082b7adf5bf962e22df74015b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158220
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-08-12 16:17:04 +00:00
Ben Konyi 6a66061703 [ Service ] Add getWebSocketTarget RPC to allow for Observatory to
connect to DDS without relying on a redirect.

Some WebSocket implementations (particularly dart:html's) don't follow
redirects and don't provide the user with the message returned by the
server.

This CL adds 'getWebSocketTarget' as an RPC which returns the
URI that should be used by the client to connect directly to the proper
web socket target. In addition, the "implicit-redirect" forwarding has
been removed.

Change-Id: Iaf88c965f6fedfa6f63c28a08860a3c80388797c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156485
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-03 22:06:41 +00:00
Ben Konyi 3450026c21 [ package:dds ] Fixed issue where an exception could be thrown during startup if the target
process had an isolate without an associated pause event.

Change-Id: I2c833335129d120aec84e3a2327d1f10560fe186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155145
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-21 17:56:44 +00:00
Ben Konyi 157ebfe50f Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This reverts commit 7e373831ce.

Change-Id: Ib94d793a5753ec6352cd9a65e35f726a63336368
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154830
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-07-21 16:23:18 +00:00
Alexander Aprelev 7e373831ce Revert "Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process""
This reverts commit bc4cb123a8.

Reason for revert: breaks crossword simarm tests https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-linux-debug-simarm_x64/2619

Original change's description:
> Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
> 
> This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.
> 
> By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:
> 
> VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
> Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
> Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/42092)
> 
> This reverts commit 3849b5061c.
> 
> Change-Id: I4fd3ba33840771a9f284d733c4a25fac6cde64ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154706
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=bkonyi@google.com,asiva@google.com

Change-Id: I649d94c668417f2edbfd7039fa5c876e10dc32fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154800
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-07-17 04:37:48 +00:00
Ben Konyi bc4cb123a8 Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.

By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:

VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/42092)

This reverts commit 3849b5061c.

Change-Id: I4fd3ba33840771a9f284d733c4a25fac6cde64ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154706
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-07-17 00:54:11 +00:00
Ben Konyi 3849b5061c Revert "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This reverts commit ffe258d2d4.

Reason for revert: Failures on bots

Original change's description:
> [ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process
> 
> This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.
> 
> By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:
> 
> VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
> Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
> Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/41978)
> 
> Change-Id: I1c6b1425831b691ad20284716aa80f817dbaf607
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152588
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: Idb1d24a4524bdc3ccfb199a82710f3c0d9db539a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154702
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-16 19:50:57 +00:00
Ben Konyi ffe258d2d4 [ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process
This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.

By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:

VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/41978)

Change-Id: I1c6b1425831b691ad20284716aa80f817dbaf607
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152588
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-07-16 19:03:24 +00:00
Ben Konyi 1e78bd069e [ package:dds ] Add missing package:shelf_static dependency in
pubspec.yaml

Change-Id: Ifd7954d66bd8af2f74d5e718d2dc6f5ccc1f738f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154564
Reviewed-by: Zichang Guo <zichangguo@google.com>
2020-07-15 21:42:11 +00:00
Ben Konyi e7b319698d [ package:dds ] Add server-sent event (SSE) support to DDS
This support is required for web clients of dwds within google3

Change-Id: Ia1ecbf8f5ba79d53cb340c83a579dc0810ec0065
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150183
Reviewed-by: Gary Roumanis <grouma@google.com>
2020-07-15 21:30:09 +00:00
Ben Konyi 505fca1ce5 [ package:dds ] Fix issue where StateError could be thrown if DDS shuts
down with in-flight requests

Related to https://dart-review.googlesource.com/c/sdk/+/154288

Change-Id: Ica7558d1abb0caec341c3dd93953240005c05a6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154560
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-15 21:11:46 +00:00
Ben Konyi b75df6f268 [ package:dds ] Fixed expression evaluator expecting a double-nested
'result' from an external 'compileExpression' implementation

Also adds expression evaluation tests for external clients.

Change-Id: Ibc1ee098df1de4d191627cbccb44e24fbcb43adf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154300
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-14 00:32:49 +00:00
Ben Konyi 28cd9ff533 [ package:dds ] Fix issue where StateError could be raised when a
client disconnects from DDS after the VM service has shutdown

Change-Id: I4f6734a125a622ff5042e39e00a1110bbe67d155
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154288
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-13 23:03:09 +00:00
Ben Konyi c54ec8d5f3 [ package:dds ] Handle expression evaluation invocations in DDS and forward compileExpression calls to clients which provide their own compilation service.
Change-Id: I2daec26929ad4f530d28d0073a0b2758850bec0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150694
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-06-11 22:43:39 +00:00
Ben Konyi da7e14a716 [ package:dds ] 1.2.0 release
Change-Id: I86eb6da074f8f3c482fbdc741993494348d125cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150670
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-06-09 23:24:36 +00:00
David Morgan 6bd4eefd82 Upgrade package:stream_channel from 2.0.0 (2.0.0 in pubpsec.yaml) to 70433d577be02c48cb16d72d65654f3b4d82c6ed (2.1.0-dev in pubspec.yaml).
R=nbosch@google.com

Change-Id: I3055efd512701d4b0c66862a473da2b425097f55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144725
Reviewed-by: David Morgan <davidmorgan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-06-09 09:12:04 +00:00
Ben Konyi 655d3c79a0 [ DDS ] Fix issue where forwarding requests with no RPC parameters would return an error
Another fix for: https://github.com/dart-lang/sdk/issues/41942

Change-Id: I43bd05db968dab92fef81b04fbe13edc0353c502
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149741
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-06-02 19:38:33 +00:00
Ben Konyi 8423423f85 [ package:dds ] Disable strict JSON-RPC protocol checks for clients
Fixes https://github.com/dart-lang/sdk/issues/41942

Change-Id: Ia0c02deaacc38159c731c1549dec1a71ddb4c8ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148781
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-20 18:22:41 +00:00
Ben Konyi 01fd2c480e [ package:dds ] Allow for JSON-RPC 2.0 requests which are missing the jsonrpc parameter
Fixes https://github.com/dart-lang/sdk/issues/41942

Change-Id: Ibbe560a70ba7b6ab1d09d46fada3f1738ea425a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148512
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-18 23:00:49 +00:00
Ben Konyi 54fb6ce3c0 [ Service / DDS ] Prepare for package:dds publishing
Final cleanup work before first full version of package:dds is
published:

- Added `getSupportedProtocols` RPC to the VM service protocol, which returns a
  list of supported service protocols and extensions along with their version
  information.
- Added `getDartDevelopmentServiceVersion` RPC to the DDS protocol.
- Misc code and dependency cleanup recommended by pub

Change-Id: If1bdf46852778adf31242122665c36b63106ad44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148224
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-15 22:52:12 +00:00
Ben Konyi 2063ce7437 [ package:dds ] Added authentication code support
Also fixed issue where not all VM flags were being forwarded to the child
of an implicit DartDev instance.

Change-Id: I4c7bacb1b93ae336b6ed1f80eb621fbeabd8ced9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148021
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-05-14 01:32:26 +00:00
Ben Konyi 444490d640 Reland "[ VM / DartDev ] Run all debugging sessions via 'dart run'"
This is a reland of 604a366065

Original change's description:
> [ VM / DartDev ] Run all debugging sessions via 'dart run'
> 
> Prior to this change, running `dart --observe foo.dart` would result in
> the DartDev flow being bypassed. While `dart foo.dart` will continue to
> bypass DartDev and be run directly, running either `dart --observe
> <vm-flags> foo.dart` or `dart --enable-vm-service <vm-flags> foo.dart`
> will result in the command being implicitly converted to `dart run
> --observe <vm-flags> foo.dart`. This is required for all standalone VM
> instances to run against DDS instead of the VM service directly.
> 
> As usual, the DartDev flow can always be bypassed by providing the
> --disable-dart-dev flag.
> 
> Change-Id: I211cd1ec4b1ec0e75ae0a568a66f1a0fc7b3852f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147342
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

Change-Id: I917d3056322d74766bdf376a3e28871ad5b66cfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147980
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-13 19:58:56 +00:00
David Morgan 964f966c0c Revert "[ VM / DartDev ] Run all debugging sessions via 'dart run'"
This reverts commit 604a366065.

Reason for revert: Breaks google3, see b/156414355

Original change's description:
> [ VM / DartDev ] Run all debugging sessions via 'dart run'
> 
> Prior to this change, running `dart --observe foo.dart` would result in
> the DartDev flow being bypassed. While `dart foo.dart` will continue to
> bypass DartDev and be run directly, running either `dart --observe
> <vm-flags> foo.dart` or `dart --enable-vm-service <vm-flags> foo.dart`
> will result in the command being implicitly converted to `dart run
> --observe <vm-flags> foo.dart`. This is required for all standalone VM
> instances to run against DDS instead of the VM service directly.
> 
> As usual, the DartDev flow can always be bypassed by providing the
> --disable-dart-dev flag.
> 
> Change-Id: I211cd1ec4b1ec0e75ae0a568a66f1a0fc7b3852f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147342
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: I688a3779e7ccaf85a28dc4d6f5ccf23596109519
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147900
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-05-13 07:13:35 +00:00
Ben Konyi 604a366065 [ VM / DartDev ] Run all debugging sessions via 'dart run'
Prior to this change, running `dart --observe foo.dart` would result in
the DartDev flow being bypassed. While `dart foo.dart` will continue to
bypass DartDev and be run directly, running either `dart --observe
<vm-flags> foo.dart` or `dart --enable-vm-service <vm-flags> foo.dart`
will result in the command being implicitly converted to `dart run
--observe <vm-flags> foo.dart`. This is required for all standalone VM
instances to run against DDS instead of the VM service directly.

As usual, the DartDev flow can always be bypassed by providing the
--disable-dart-dev flag.

Change-Id: I211cd1ec4b1ec0e75ae0a568a66f1a0fc7b3852f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147342
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-05-12 19:53:11 +00:00
Ben Konyi 755a315dc5 [ package:dds ] Added support for log history in DDS
Added the following RPCs to the DDS protocol:
- getLogHistoryLength
- setLogHistoryLength

Historical logs will be sent to clients when they connect and subscribe
to the Logging stream for the first time. Current default log history
length is 10,000 messages to support applications with chatty logging at
startup.

Change-Id: Ic6cd9c58673fbb7179b6ac0f1f6581cb8ada03fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146444
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-05-08 23:30:36 +00:00
Ben Konyi af5f54569c Reland "[ package:dds / Service ] Added support for client naming and resume permissions"
This reverts commit e572bed03e.

Change-Id: I8d8c364e22f7e31c172ea871b2eac3b29fd3577b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145702
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-01 02:09:07 +00:00
Ben Konyi e572bed03e Revert "[ package:dds / Service ] Added support for client naming and resume permissions"
This reverts commit bb959fc0de.

Reason for revert: Failing tests

Original change's description:
> [ package:dds / Service ] Added support for client naming and resume permissions
> 
> Also marked `getClientName`, `setClientName`,
> `requirePermissionToResume` and `ClientName` as deprecated in the VM
> service specification as these features will be moving to DDS and will
> be removed in VM service protocol 4.0.
> 
> Change-Id: I4628ece96349a9883ee9d726d82e5cfae028a826
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144986
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: I4e56cd93ad1eeefe69cd632dc798324271274dd7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145662
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-30 20:51:46 +00:00
Ben Konyi bb959fc0de [ package:dds / Service ] Added support for client naming and resume permissions
Also marked `getClientName`, `setClientName`,
`requirePermissionToResume` and `ClientName` as deprecated in the VM
service specification as these features will be moving to DDS and will
be removed in VM service protocol 4.0.

Change-Id: I4628ece96349a9883ee9d726d82e5cfae028a826
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144986
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-30 20:00:22 +00:00
Ben Konyi c97ed9cc11 [ package:dds / Service ] Add support for service extensions to DDS
With this change, DDS takes responsibility for service extension
registration via the service protocol in addition to handling service
extension request routing.

Service extensions registered through dart:developer will continue to
be handled by the VM service as those extensions live within the main
Dart process (this functionality already worked before this CL).

This change also includes a version bump for package:json_rpc_2 to pull
in a bug fix required for this change.

Change-Id: Idb6050058f7695d34276953be159419a5b1b9711
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144349
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-04-24 17:13:57 +00:00
Ben Konyi f9816cdc35 [ DDS / Service ] Put the VM service into single client mode when DDS connects
Added a private RPC, _yieldControlToDDS, which DDS invokes once
connected to the VM service. Once this method is called, the following
happens:

- The VM service stops accepting new web socket requests.
- The VM service enters single client mode, where DDS is the single
  client.

DDS can only place the VM service in single client mode when it is the only
VM service client. If other clients are connected, DDS will fail to start and
throw an exception.

The purpose of this change is to simplify state management between the
VM service and DDS. The plan is to delegate the following features to
DDS:

- Service extension management
- Custom client name support
- Isolate resume coordination for multiple clients

Change-Id: I0b3143710d94ee9444a4894e24555f7ed1caf5ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142564
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-04-22 22:03:59 +00:00
Ben Konyi 5b19445d9c Reland "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests"
This reverts commit cccddf3530.

Change-Id: Iabde3542d5be33ffabf50efd9226597aef876ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143961
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-17 21:12:44 +00:00
Alexander Aprelev cccddf3530 Revert "Reland "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests""
This reverts commit e5b85792da as it seems to have broken service/pause_on_start_and_exit_with_child_test/service https://ci.chromium.org/p/dart/builders/ci.sandbox/app-kernel-linux-debug-x64/5877

Change-Id: Idb9df51816eebfb58137c449c6461731c77409f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143881
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-16 23:37:25 +00:00
Ben Konyi e5b85792da Reland "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests"
Fixes buildbot failures by running VM service and DDS service tests in
separate test processes.

This reverts commit 1f0c90868c.

Change-Id: I0ad9b2e6ccea4d5468dd4dcdde0e286bcbf820ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142902
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-16 17:59:25 +00:00
Ben Konyi 1f0c90868c Revert "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests"
This reverts commit 6b2419ddaf.

Reason for revert: Failures on bots. Reverting.

Original change's description:
> [ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests
> 
> This change adds stream forwarding to the Dart Development Service,
> allowing for clients to subscribe to service protocol streams with DDS
> instead of the VM service directly. DDS will maintain a single
> subscription for each stream as long as at least one client is listening
> to that stream. A DDS stream subscription will be closed when the last
> client listening to that stream either disconnects or calls
> streamCancel.
> 
> This change also enables DDS for most of the Observatory services tests,
> excluding thoses which utilize:
> 
> - Service extensions
> - Client naming
> - Client isolate resume synchronization
> 
> Change-Id: I5641e879a7626fcd5e4d28434ed480dd72fc7659
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142083
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: I185e63eabca54a3dff49d4f5a8a126795cadfa80
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-08 00:07:38 +00:00
Ben Konyi 6b2419ddaf [ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests
This change adds stream forwarding to the Dart Development Service,
allowing for clients to subscribe to service protocol streams with DDS
instead of the VM service directly. DDS will maintain a single
subscription for each stream as long as at least one client is listening
to that stream. A DDS stream subscription will be closed when the last
client listening to that stream either disconnects or calls
streamCancel.

This change also enables DDS for most of the Observatory services tests,
excluding thoses which utilize:

- Service extensions
- Client naming
- Client isolate resume synchronization

Change-Id: I5641e879a7626fcd5e4d28434ed480dd72fc7659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142083
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-07 23:18:45 +00:00
Ben Konyi b42c2857f8 [ package:dds ] Fixed smoke_test.dart which was unable to launch smoke.dart due to use of a relative path.
Change-Id: I8dc99b41d00ec571843f576fb25e688f19ebde74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141362
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-03-27 20:17:46 +00:00
Ben Konyi a74e877104 [ package:dds ] Initial commit of the Dart Development Service, package:dds
- Defined initial interface
- Currently can spawn an HTTP server and forward websocket and HTTP
requests to the VM service
- Simple smoke tests
- Initial documentation in dds_protocol.md and other book keeping
- Enabled analysis on bots

Change-Id: Ia11e9e33fd10b0b4700b704a29e2977341441cec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139542
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-03-19 23:36:45 +00:00