-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--enable-vm-service
flag behaviors are inconsistent between debugger and cli
#56733
Comments
Summary: The |
@bkonyi my guess is that this is because the flag is passed to the VM by the debug adapter and the original VM Service does use that port, but then the debug adapter starts DDS which binds a new port, and we take the URI from that? sdk/pkg/dds/lib/src/dap/adapters/dart.dart Line 792 in a6a2c57
What's the best way to handle this? Can we return the normal VM Service URI (I can't remember if DDS needs to proxy all the traffic or is just registering new services etc.)? If not, I wonder if we'd need to either parse the VM args in DAP (which doesn't seem ideal to duplicate here) and use the port for DDS instead of passing it to the VM? |
It seems like that's the case.
All traffic should go through DDS as any attempt to connect directly to the VM service while DDS is connected will either fail or get a redirect to DDS (depending on whether or not the websocket implementation allows for following redirects). While there's definitely a way to handle this properly, I'm wondering why the Dart DAP adapter even needs to start DDS itself? I honestly can't remember why we decided to do this, but since we don't rely on |
I think we wanted to avoid an additional process and thought we might one day have DDS + DAP closer together (to avoid additional layers). I don't know if that still makes any sense though, and Flutter always has its own DDS and is hard-coded to set If you think it makes no sense to do here, I will remove it (keeping constructor the flag as a no-op initially, to simplify rolling the update into Flutter) and do some testing. |
I've a change open to remove DDS from DAP here: https://dart-review.googlesource.com/c/sdk/+/386500 With that change, the flags noted above work as expected: (Although FWIW using |
CC @DanTup (re conversation: https://discord.com/channels/608014603317936148/1282837915847757964)
Given the following Dart script:
... and the following launch config and cli commands:
launch.json (debugger):
cli command:
dart run --observe --enable-vm-service=6968 --disable-service-auth-codes bin/main.dart
The output / behavior is different.
debugger output (incorrect expected behavior)
cli output (correct expected behavior)
The text was updated successfully, but these errors were encountered: