Commit Graph

504 Commits

Author SHA1 Message Date
Derek Xu bfbbe5c6b6 [VM/Service] Delete all the Service ID zones created by a client when it disconnects
TEST=pkg/vm_service/test/id_zone_deletion_on_client_disconnect_with_dds_test.dart,
pkg/vm_service/test/id_zone_deletion_on_client_disconnect_without_dds_test.dart,
CI

Issue: https://github.com/dart-lang/sdk/issues/55869
CoreLibraryReviewExempt: This CL does not include any core library API
changes, only VM Service implementation changes in
sdk/lib/vmservice/client.dart and
sdk/lib/vmservice/running_isolates.dart.
Change-Id: I32a72ade89b858519c61b5124adbeafb835c3d61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381520
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-10-02 15:46:31 +00:00
Derek Xu c4a77dce65 [DDS] Make runDartDevelopmentServiceFromCLI pass the specified bind address directly into startDartDevelopmentService
Resolving the bind addres before passing it into startDartDevelopmentService was causing some problems with debugging web applications in g3.

TEST=patched these changes into g3 and confirmed that they restore the ability to debug the hello_flutter sample

Change-Id: I2e10be1e2e73245e00d2c3936697b736029a7d47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387280
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-10-01 14:32:29 +00:00
Kenzie Davisson 716deb3a26 Bump tools_rev in DEPS.
This needs to be bumped so that the latest changes to unified_analytics can be automatically rolled into g3 with the next Dart SDK roll.

Change-Id: I766951852258acfdfd66aa960412f3f5d6ac6fb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387502
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2024-09-30 22:50:51 +00:00
Danny Tuppeny 2cf6ba2d55 [dds/dap] Handle VM Service shutdown exceptions when resuming
This will hopefully fix the flaky tests noted in https://github.com/dart-lang/sdk/issues/55313. I believe when we resume from pause-on-exit, the VM might shut down fast enough that the response is not handled and throws "Service connection disposed" (see https://github.com/dart-lang/sdk/issues/55313#issuecomment-2376593906).

This change will discard any known shutdown errors while sending the request instead.

Change-Id: I7c10aa3eddd6e651114ddba948b0a17688352720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386806
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-09-26 15:56:42 +00:00
Ben Konyi 12d9f40961 Reapply "[ CLI ] Don't disable DDS when --disable-dart-dev is provided"
This reverts commit 9f5246e8c6.

TEST=Existing tests

Change-Id: I658290f248d8b26c05f24b7125c3ba71de318bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385121
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-09-26 15:29:05 +00:00
Danny Tuppeny 560adc7dc6 [dds/devtools] Switch to always using a relative base href in DevTools pages
This avoids the server needing to know the exact URL path being used on the client, so proxies that rewrite the path (such as code-server) can still work.

See https://github.com/flutter/devtools/issues/8067#issuecomment-2236419703

Change-Id: I5b131d84232c63f5495ccbb533da727cce514de5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376682
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-09-26 15:19:54 +00:00
Derek Xu 6121c396ee [VM/Service] Expose Service ID zone APIs in service.md and package:vm_service
TEST=pkg/vm_service/test/id_zones_test.dart, CI

Issue: https://github.com/dart-lang/sdk/issues/55869
CoreLibraryReviewExempt: This CL does not include any core library API
changes, only VM Service implementation changes in
sdk/lib/vmservice/running_isolates.dart.
Change-Id: Id63180fd08a88865064435b056fa3269835cd476
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381400
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-09-25 17:28:44 +00:00
Danny Tuppeny 34c223c8f9 [dds/dap] Temporarily enable verbose logging for test runs
This may help track down the flakes discussed in https://github.com/dart-lang/sdk/issues/55313 (see https://github.com/dart-lang/sdk/issues/55313#issuecomment-2329050007).

Change-Id: I1a2bc2996ab45498c9b34834df692d5a51982fff
Cq-Include-Trybots: luci.dart.try:pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383640
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-09-13 16:01:59 +00:00
Chingjun Lau 2483d300f9 Change the type of google3WorkspaceRoot to String.
This is a followup to https://dart-review.googlesource.com/c/sdk/+/383901

Remove the temporary backward compatibility now that users of this
function has all been migrated.

Bug: b/364942683
Change-Id: I8f951c6eb143497fb9edbf1465417d121a1cbf72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384827
Auto-Submit: Chingjun Lau <chingjun@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-09-13 14:27:11 +00:00
Ben Konyi 9f5246e8c6 Revert "[ CLI ] Don't disable DDS when --disable-dart-dev is provided"
This reverts commit 81b9957bdd.

Reason for revert: Breaking multiple configurations.

Original change's description:
> [ CLI ] Don't disable DDS when --disable-dart-dev is provided
>
> Fixes https://github.com/dart-lang/sdk/issues/56605
> Fixes https://github.com/dart-lang/sdk/issues/54841
>
> TEST=N/A
>
> Change-Id: I6a13afe5f51fe67d2366c6d87ae74473651e24c8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383780
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Auto-Submit: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Phil Quitslund <pquitslund@google.com>

Change-Id: I5c6cb302d8160f19bad437341cdcd80bcc08d921
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384881
Reviewed-by: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-09-12 01:15:27 +00:00
Ben Konyi a5cd16c0cb [ DDS ] Fix failing tests
Fixes failing tests introduced by
https://dart-review.googlesource.com/c/sdk/+/383780.

Change-Id: I700543f4dc6481dd905ffdc44177b009612565d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384880
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-09-11 21:43:08 +00:00
Ben Konyi 81b9957bdd [ CLI ] Don't disable DDS when --disable-dart-dev is provided
Fixes https://github.com/dart-lang/sdk/issues/56605
Fixes https://github.com/dart-lang/sdk/issues/54841

TEST=N/A

Change-Id: I6a13afe5f51fe67d2366c6d87ae74473651e24c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383780
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-09-11 18:01:25 +00:00
Danny Tuppeny f50975e3b5 [dds] Bump DDS to 5.0.0, use devtools_shared 11.0.0, and support a second DTD URI for web editors
devtools_shared 11.0.0 updates some signatures to use a new DTDInfo class to support both a local + exposed URI for DTD. A new CLI flag `--dtd-exposed-uri` for `devtools server` allows passing this second URI.

The DevTools server will use `--dtd-uri` to connect to DTD itself, but serve `--dtd-exposed-uri` to the frontend.

`--dtd-exposed-uri` is entirely optional and if not supplied, the value from `--dtd-uri` will be used in its place.

Change-Id: I5ab052ff9c4e7b2b186c1592f1ba2d63b7711113
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383400
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
2024-09-11 17:05:09 +00:00
Ben Konyi 13b2e73fe2 [ DDS ] Prep for 4.2.7 release
Change-Id: Iad4af13c3744743937e5412e546ef8d260122ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384620
Reviewed-by: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-09-10 19:15:16 +00:00
Chingjun Lau 1850fbbb3a Change the type of google3WorkspaceRoot to Uri | String.
A subsequent CL will be sent to change this to String, after
flutter_tools is migrated to pass a String instead of a Uri.

BazelUriConverter treats google3WorkspaceRoot as a String. Passing a Uri
causes the debug adapter to pass `--google3-workspace-root=file:///`
when launching DDS, making it fail to resolve the uris.

Bug: b/364942683
Change-Id: I46f366bb2308a107a68e63445138e071432e45de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383901
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Chingjun Lau <chingjun@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-09-06 16:07:00 +00:00
Danny Tuppeny e099a00ee2 [dds] [vm_service] Add a new RPC error code for "Service Disposed" errors
This is not currently used for errors but just adds constants to allow clients to write code to handle these kinds of errors so we can use them in future (instead of generic error codes with string messages).

DAP is also updated ready to handle this error code.

See https://github.com/flutter/flutter/issues/153471

Change-Id: I6ad030d0317e9a70d9e28578787edec75554daad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381501
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-09-03 14:54:18 +00:00
Ben Konyi 1bf48b070c [ DDS ] Prepare for 4.2.6 release
Change-Id: Ibd9f120837f7fba997a08fef009459f21bbd9e4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382940
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-08-29 18:53:10 +00:00
Derek Xu 6b978a8339 [VM/Service] Add secret _idZoneId parameters to all Service methods
TEST=pkg/vm_service/test/id_zones_test.dart, CI

Issue: https://github.com/dart-lang/sdk/issues/55869
CoreLibraryReviewExempt: This CL does not include any core library API
changes, only VM Service implementation changes in
sdk/lib/vmservice/running_isolates.dart.
Change-Id: Ib8af3f073f6db9172df90a5ea221269411f72156
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379545
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-08-28 16:41:50 +00:00
Ben Konyi 1c002567b8 [ DDS ] Add tests for DDS exception parsing
Follow up to https://github.com/flutter/flutter/issues/152684

Change-Id: I9477ccae9f1eab63a800443c654ae3b348023d82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382021
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-08-23 19:23:00 +00:00
Ben Konyi 13285dc8f8 [ DDS ] Prefer IPv6 addresses if the VM service is using IPv6
Fixes https://github.com/dart-lang/sdk/issues/56557

Change-Id: I6c18f31a49e6e0d924a467b4b8c1f9d5709d47d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382020
Commit-Queue: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-08-23 15:33:54 +00:00
Ben Konyi e0d140c01e [ DAP ] Migrate DAP to launch DDS with DartDevelopmentServiceLauncher
Part of the process to remove uses of
DartDevelopmentService.startDartDevelopmentService in favor of launching
with `dart development-service`.

Change-Id: I857aee932c0b2fc6ae2172eb106b78c76d536295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380760
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-08-22 19:46:11 +00:00
Srujan Gaddam ac038f7e84 [dds] Roll chrome_tag, browser_launcher_rev, and add --use-mock-keychain flag to dds
With this roll, Chrome now triggers a dialog on MacOS requesting
credentials. This results in timeouts for
pkg/dds/test/devtools_server/remote_control_test. To avoid user
input, we use a mock keychain instead. The same change has gone
into browser_launcher_rev, and so we include that commit here.

Bug: https://github.com/dart-lang/sdk/issues/56519
Change-Id: I0e0733b658eb09b0775178e617e5ceb42e184ec4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381705
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-08-22 18:17:51 +00:00
Kenzie Schmoll 428e52e00c Bump DevTools DEPS and bump the devtools_shared dependency in DDS.
Change-Id: I561d0880cb35ca04b3ae3fdefdb4700003db3fd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381380
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2024-08-19 21:12:48 +00:00
Danny Tuppeny 212e49fda6 [dds/dap] Treat "Service Connection Disposed" the same as "Client closed with pending request"
Should fix https://github.com/flutter/flutter/issues/153473

Change-Id: I77bcf2da01d340412c3dc709a74cc8ed2d80a43f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381181
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2024-08-19 18:12:14 +00:00
Devon Carew 89532d54ed [deps] rev package:lints to capture the unnecessary_library_name addition
Change-Id: I6ca4b0cef189248eac4d0898e8549424f2d889bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380180
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2024-08-13 17:04:13 +00:00
Ben Konyi e859ee5422 [ Service ] Ensure Service.controlWebServer doesn't return until DDS has started
Before this change, Service.controlWebServer would block on the first
call, waiting until DDS had finished starting to respond, while
subsequent calls would return as soon as the VM service HTTP server had
started, exposing the internal VM service URI. This could result in
clients connecting directly to the VM service while DDS was
initializing, only for them to be disconnected immediately once DDS
invoked _yieldControlToDDS.

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

TEST=pkg/dds/test/control_web_server_regress_56254_test.dart

Change-Id: Ic707882263caa9ffe832e768c37492dfde43b611
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379700
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-08-09 13:57:48 +00:00
asiva e8c035308b [VM/Runtime] Fix writeln to ensure the entire write is atomic
Should fix https://github.com/dart-lang/sdk/issues/55345

TESTS=ci

Change-Id: I2872ec75ca3249fa91032b70474ed84ffc463bb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378024
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-08-08 20:31:59 +00:00
Ben Konyi fe3a90ad36 [ DDS ] Fix uri_converter_test on Windows
Fixes https://github.com/dart-lang/sdk/issues/55411

Change-Id: I68141cf11b3563d305b7ed317ab6236e32b68bb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379680
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-08-08 15:10:50 +00:00
Ben Konyi 37c16d095c [ DDS ] Revert removal of --google3-workspace-root option
This option is still needed for Flutter in Google3, which uses DDS from
the external SDK rather than the custom Google3 DDS entrypoint.

Change-Id: I982238a63adde1a80f7226a7f2713cd5d610553f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379540
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-08-08 00:09:41 +00:00
Ben Konyi dbe6d5852a Fix bad pattern matching in DDS exception parsing
Nullable types for values in map patterns require the key to be present. Since the 'uri' key is not always present in DDS exception responses, this was causing us to fall back to throwing a StateError.

Related issue: https://github.com/flutter/flutter/issues/152684

Change-Id: I929e1e880c4fc6f740ee595e6e852f23fa247b92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378600
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-08-01 20:03:34 +00:00
Ben Konyi 7eef09cd6e [ package:dds ] Add DartDevelopmentServiceLauncher class
Provides shared logic for launching DDS using `dart
development-service`.

Change-Id: I934c777ada23206b498731ffb0611ed3bd383f1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378320
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-08-01 14:29:59 +00:00
Danny Tuppeny 8ab91cd9db [dds/dap] Ensure formatting applies to values of type_data lists
When formatting numbers as hex, this should apply to values decoded from typed_data lists too.

Fixes https://github.com/Dart-Code/Dart-Code/issues/5199

Change-Id: I02f3437fa202e5227e9fe0c8df621de846bc3edc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377423
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-07-30 14:55:06 +00:00
Danny Tuppeny ef0e0ee2b6 [dds/dap] Allow sending verbose logs to DAP client to be toggled during a debug session
Capturing debug logs that includes VM Service traffic is useful for debugging. Previously with the new DAPs, this could only be enabled at session start which meant users would have to capture very large log files.

This adds the ability to enable/disable this logging while a debug session is already running. A related change in Dart-Code will send this request when you use the "Capture Debugging Logs" command, so you can start a debug session, get to the point of reproducing an issue, and then just capture the relevant logs (VM Service traffic included).

Fixes https://github.com/Dart-Code/Dart-Code/issues/5197

Change-Id: I7e766e57bd80819eb5da164e544903fae23927ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377222
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-07-24 16:51:33 +00:00
Ben Konyi 3761bc22b4 [ DDS ] Update comment for DevTools URI getter
Change-Id: I92ff9ff1e69a8e7b31a943d0ef7179cbfcb758e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377262
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-07-23 22:47:11 +00:00
Ben Konyi 6864b90126 [ DDS ] Fix DevTools URI not including a trailing '/' before query parameters
This could prevent DevTools from loading correctly as it expects assets
to be located at '<DDS_URI>/devtools/'

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

Change-Id: I0e976a42a9fb1b4896d238674d2c8c8ec99ce7ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376762
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-07-19 22:22:25 +00:00
Danny Tuppeny ae6ed09fc1 [dds] Add cross-origin-resource-policy to DevTools server to enable WASM when embedded
See https://github.com/flutter/devtools/issues/7856#issuecomment-2147440081

Change-Id: If9d19eef8f8475e3dddb70db55e6b72e0ceb6f08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374945
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-07-11 15:59:15 +00:00
Ben Konyi a16a6537e5 Reland "Reapply "[ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer""
This reverts commit 3370a4e393.

Reason for revert: Fixes landed in google3 (cl/650630536).

Original change's description:
> Revert "Reapply "[ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer""
>
> This reverts commit 44d4451476.
>
> Reason for revert: b/350443042
>
> Original change's description:
> > Reapply "[ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer"
> >
> > In the previous version of this change, if the user had 'dart' on their
> > PATH and invoked 'dart compile js' (which spawns the VM service after
> > compilation completes), the VM service would attempt to spawn DDS using
> > './dart' as the executable path instead of 'dart'. This would result in
> > DDS failing to start, causing the VM to print an error and hang.
> >
> > This updated change checks to see if the parent directory of
> > `Platform.executable` is '.' and then verifies if './dart' exists or
> > not. If it doesn't, 'dart' is likely on the user's PATH and should be
> > used directly as the executable path.
> >
> > See https://github.com/dart-lang/sdk/issues/56087 for details.
> >
> > This reverts commit 4b88698e48.
> >
> > TEST=pkg/dds/test/control_web_server_starts_dds_with_dart_on_path_test.dart
> >
> > Change-Id: Id0f1dadd01d9202cbf7717f31393b43171cf3968
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373561
> > Auto-Submit: Ben Konyi <bkonyi@google.com>
> > Reviewed-by: Derek Xu <derekx@google.com>
> > Commit-Queue: Ben Konyi <bkonyi@google.com>
>
> Change-Id: I424c4b91b0b108ae4c9dffa0059ed90c918897e3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373744
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Srujan Gaddam <srujzs@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>

Change-Id: Id7ddff5a80399203fb8058d84bc89fda2073da95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375000
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-07-09 15:34:16 +00:00
Elliott Brooks e4e06c6cbd Read the showToUser field on DebugAdapterException to determine whether or not to show DAP errors to the user.
Currently, we are only showing errors to the user if they occur as part of the attach or launch workflows.

Note: The `showToUser` field was added in https://dart-review.googlesource.com/c/sdk/+/369720

Bug: https://github.com/dart-lang/sdk/issues/55789
Change-Id: Idd6bc233fd2f1d5420292095517fd050715e1311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368523
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-07-08 17:31:42 +00:00
Elliott Brooks 2943f4399e Update DDS CONTRIBUTING docs
Change-Id: Ia92b06a5f18eb3e090157d4df5f509297b70958c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374121
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
2024-07-03 21:02:46 +00:00
Ivan Inozemtsev 3370a4e393 Revert "Reapply "[ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer""
This reverts commit 44d4451476.

Reason for revert: b/350443042

Original change's description:
> Reapply "[ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer"
>
> In the previous version of this change, if the user had 'dart' on their
> PATH and invoked 'dart compile js' (which spawns the VM service after
> compilation completes), the VM service would attempt to spawn DDS using
> './dart' as the executable path instead of 'dart'. This would result in
> DDS failing to start, causing the VM to print an error and hang.
>
> This updated change checks to see if the parent directory of
> `Platform.executable` is '.' and then verifies if './dart' exists or
> not. If it doesn't, 'dart' is likely on the user's PATH and should be
> used directly as the executable path.
>
> See https://github.com/dart-lang/sdk/issues/56087 for details.
>
> This reverts commit 4b88698e48.
>
> TEST=pkg/dds/test/control_web_server_starts_dds_with_dart_on_path_test.dart
>
> Change-Id: Id0f1dadd01d9202cbf7717f31393b43171cf3968
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373561
> Auto-Submit: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Derek Xu <derekx@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

Change-Id: I424c4b91b0b108ae4c9dffa0059ed90c918897e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373744
Reviewed-by: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
2024-07-01 18:30:28 +00:00
Ben Konyi 44d4451476 Reapply "[ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer"
In the previous version of this change, if the user had 'dart' on their
PATH and invoked 'dart compile js' (which spawns the VM service after
compilation completes), the VM service would attempt to spawn DDS using
'./dart' as the executable path instead of 'dart'. This would result in
DDS failing to start, causing the VM to print an error and hang.

This updated change checks to see if the parent directory of
`Platform.executable` is '.' and then verifies if './dart' exists or
not. If it doesn't, 'dart' is likely on the user's PATH and should be
used directly as the executable path.

See https://github.com/dart-lang/sdk/issues/56087 for details.

This reverts commit 4b88698e48.

TEST=pkg/dds/test/control_web_server_starts_dds_with_dart_on_path_test.dart

Change-Id: Id0f1dadd01d9202cbf7717f31393b43171cf3968
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373561
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-06-27 22:47:46 +00:00
Ben Konyi 4b88698e48 Revert "[ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer"
This reverts commit 64d4689a78.

Reason for revert: Platform.executable doesn't return a path, just an executable name, which can cause breakages.

TEST=ci

Original change's description:
> [ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer
>
> TEST=pkg/dds/test/control_web_server_starts_dds_test.dart
>
> Change-Id: I2e51783592912e5a719685f2ab5e7537b7a59586
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366560
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Derek Xu <derekx@google.com>

Change-Id: I4ceaee4b5ca8f5557e90cd914ee69fe9aa5f85a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373381
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-06-26 22:36:09 +00:00
Ben Konyi 50972b8224 Remove extra null check in control_web_server_starts_dds_test
Follow up to https://dart-review.googlesource.com/c/sdk/+/366560

Change-Id: I4057f491aca1b480db3b5360c5f5713e03360b55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373180
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-06-25 20:03:09 +00:00
Ben Konyi 64d4689a78 [ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer
TEST=pkg/dds/test/control_web_server_starts_dds_test.dart

Change-Id: I2e51783592912e5a719685f2ab5e7537b7a59586
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366560
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-06-25 16:25:33 +00:00
Ben Konyi 1c57c6cbae [ package:dds ] Update CHANGELOG and pubspec to 4.2.4+1 (republished 4.2.4)
4.2.4 was retracted due to an extra binary being included in the archive
that increased the package size by 10x.

Change-Id: Iebca85555e871fee22bafdd1bf547972bfe5b201
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372920
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-06-24 14:13:55 +00:00
Ben Konyi 56416078a0 [ DDS ] Remove extra stderr.close()
Change-Id: Ice61586e2a60d039987b1e3b5f5f328cc46fb41e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371880
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
2024-06-17 14:44:22 +00:00
Ben Konyi 9304826679 [ DDS ] Refactor DDS entrypoint to allow for overriding behavior in google3
This moves the CLI logic into lib/src/dds_cli_entrypoint.dart so it can
be invoked by a custom google3 entrypoint (bin/dds.dart can't be
imported using a package: URI).

Since google3 will be able to perform some custom configuration of DDS,
google3 related logic (e.g., `BazelUriConverter`) is also removed. This
is technically a breaking change, but should be safe as this
functionality isn't currently being used.

Change-Id: I54d8a9927ff2df70e013ca5c8bc1d510b0b95f02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371520
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-06-13 20:27:22 +00:00
Ben Konyi cf9623f3d9 [ DDS ] Update DDS launch sites to assume DDS process closes stderr
Removes risk of DDS connection information being split across two stream
events, causing JSON decoding to fail.

Also updates DDS to close stderr, even in the error case.

TEST=Existing service and dartdev tests

Change-Id: I5cceab899aac1fa63bd7578dd658b34096722bd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371000
Reviewed-by: Derek Xu <derekx@google.com>
2024-06-11 18:41:01 +00:00
Devon Carew f97004f639 Bump collection to c90b19f07b48391f3b1b4c39dd06ef0177f8e07c
Changes:
```
> git log --format="%C(auto) %h %s" 141d83a..c90b19f
 https://dart.googlesource.com/collection.git/+/c90b19f blast_repo fixes (348)
 https://dart.googlesource.com/collection.git/+/a1d2507 Add flattenedToList and flattenedToSet (328)
 https://dart.googlesource.com/collection.git/+/e9219c7 Deprecate whereNotNull from IterableNullableExtensions (332)
 https://dart.googlesource.com/collection.git/+/9e441f1 Deprecate transitiveClosure (336)

```

Diff: https://dart.googlesource.com/collection.git/+/141d83af3d7586ae9d27de610fd426071c98e5d3..c90b19f07b48391f3b1b4c39dd06ef0177f8e07c/
Change-Id: I9ed24345c132ad92ae65c5e70ab37647fad0ec00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370960
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-06-11 17:27:21 +00:00
Ben Konyi d96ff605e2 [ CLI / DDS ] Close stderr for dart development-service after connection details have been printed
This will simplify logic in clients parsing this information by
providing a clear signal that all connection data has been sent over the
stream and is ready to be decoded.

Change-Id: Iae3779fe13662bf15187e9fa41febba94af4f2c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370940
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-06-11 16:06:47 +00:00