Commit Graph

511 Commits

Author SHA1 Message Date
Danny Tuppeny 5b9d75ff20 [dds/dap] Use ID Zones for evaluation requests and invalidate them on resume
Fixes https://github.com/dart-lang/sdk/issues/56794

Change-Id: Ied408503d22c4abb2c4f996f6c9b7847b8ad82be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389960
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-10-30 18:41:13 +00:00
Danny Tuppeny 97ab888201 Remove spawning of DDS from DAP and let the spawned dart run/dart test do it
Fixes https://github.com/dart-lang/sdk/issues/56733

Change-Id: I23acd9ba4cd48dd7fe5e23fc388d143db8779754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386500
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-10-24 20:44:34 +00:00
Derek Xu da9d9f254b Reland "[DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address"
This is a reland of commit 4391ca6643

I have verified that internal CL 687283510 will permit this change to
land without issue.

Original change's description:
> [DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address
>
> TEST=CI
>
> Fixes: https://github.com/dart-lang/sdk/issues/56557
> Change-Id: Id06532aedf26d8d5e4d037df72dece2d6550e694
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389521
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: Ib7536f61d49526e67d449ca0a475f379ad4bd362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390760
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-10-18 14:38:07 +00:00
Derek Xu cec29f1306 Revert "[DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address"
This reverts commit 4391ca6643.

Reason for revert: breaks internal tests

Original change's description:
> [DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address
>
> TEST=CI
>
> Fixes: https://github.com/dart-lang/sdk/issues/56557
> Change-Id: Id06532aedf26d8d5e4d037df72dece2d6550e694
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389521
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: I02709235d32abab122b5269a5d80f12c4085988b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390542
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-10-16 22:15:28 +00:00
Danny Tuppeny dfa9cc0f48 [dds/dap] Enable verbose logging for flaky test
Trying to track down the failure shown here, but haven't had any luck reproducing it locally or on the trybots:

https://dart-ci.appspot.com/log/pkg-linux-release/unittest-asserts-release-linux-x64/28665/pkg/dds/test/dap/integration/debug_exceptions_test


Change-Id: Ied27b69324a602a4039eedfe997c604f6212f5b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390221
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-10-15 17:28:25 +00:00
Derek Xu cdacfd80f1 [VM/Debugger] Ensure that a breakpoint can only resolve on the exact line that was specified in a request
TEST=CI

Fixes: https://github.com/dart-lang/sdk/issues/56820
Change-Id: Ic04400ce6a15d7a2450b05bd5753087350ae52b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388460
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-10-15 16:57:36 +00:00
Derek Xu 4391ca6643 [DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address
TEST=CI

Fixes: https://github.com/dart-lang/sdk/issues/56557
Change-Id: Id06532aedf26d8d5e4d037df72dece2d6550e694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389521
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-10-10 19:22:50 +00:00
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