Skip to content
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

[dartdev] Fails to report VM service URL on Windows when run from different drive #55830

Closed
dnys1 opened this issue May 23, 2024 · 7 comments
Closed
Assignees
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-run Issues related to 'dart run' P1 A high priority bug; for example, a single project is unusable or has many test failures triaged Issue has been triaged by sub team

Comments

@dnys1
Copy link
Contributor

dnys1 commented May 23, 2024

Starting with Dart 3.4.0, dart run fails to report the VM service URL on Windows when the command is run from a separate drive.

Assuming the dart executable lives on the C:\ drive and this simple Dart program (example.dart):

void main() => print('Hello, World');
  1. Running dart run from C:\ drive (base case)
PS C:\workspace> dart run --enable-vm-service=0 .\example.dart
The Dart VM service is listening on http://127.0.0.1:50153/cbhV5WcNEvU=/
The Dart DevTools debugger and profiler is available at: http://127.0.0.1:50153/cbhV5WcNEvU=/devtools?uri=ws://127.0.0.1:50153/cbhV5WcNEvU=/ws
Hello, World!
  1. Running from the D:\ drive
PS D:\workspace> dart run --enable-vm-service=0 .\example.dart
Hello, World!

Interestingly, the VM service does seem to be starting, though, since the following prints a URL.

PS D:\workspace> dart run --observe=0 .\example.dart
Hello, World!
vm-service: isolate(5632243645610243)  'main' has no debugger attached and is paused at exit.  Connect to the Dart VM service at http://127.0.0.1:50164/5eI1O7H6CDg=/ to debug.

There doesn't seem to be a good workaround for this, either:

  • --enable-vm-service=<open port> does not spawn on the provided port
  • --write-service-info does not create the file (tried different drive letter, relative/absolute combos)
@mit-mit
Copy link
Member

mit-mit commented May 24, 2024

cc @bkonyi @kenzieschmoll

@lrhn lrhn added area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-devtools Issues related to the 'dart devtools' tool labels May 25, 2024
@dnys1
Copy link
Contributor Author

dnys1 commented May 27, 2024

Seems to be an issue in DDS. I haven't looked into the code at all, but I found that passing --no-dds produces the expected output.

@bkonyi
Copy link
Contributor

bkonyi commented May 29, 2024

Thanks for the details @dnys1! I'll take a look to see if I can reproduce.

@bkonyi bkonyi added P1 A high priority bug; for example, a single project is unusable or has many test failures dart-cli-run Issues related to 'dart run' triaged Issue has been triaged by sub team and removed dart-cli-devtools Issues related to the 'dart devtools' tool labels May 29, 2024
@bkonyi bkonyi self-assigned this May 29, 2024
@bkonyi
Copy link
Contributor

bkonyi commented Jun 3, 2024

I'm unable to reproduce this on the main branch (Dart 3.5.0-edge.4692937341db70e60ee6b58bb75c6a0c621e14b0). @dnys1 can you run dart info and share the output here?

@bkonyi bkonyi added the needs-info We need additional information from the issue author (auto-closed after 14 days if no response) label Jun 3, 2024
@dnys1
Copy link
Contributor Author

dnys1 commented Jun 4, 2024

Thanks, @bkonyi. The above was discovered on the Dart stable branch (3.4.1).

Trying with flutter master, I get the following output:

PS D:\workspace\dev_test> dart run --enable-vm-service=0 .\example.dart
Hello, World!
Could not start the VM service:
DartDevelopmentServiceException: Failed to start Dart Development Service

dart info

PS D:\workspace\dev_test> dart info

If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

#### General info

- Dart 3.5.0-219.0.dev (dev) (Mon Jun 3 17:02:15 2024 -0700) on "windows_x64"
- on windows / "Windows 10 Pro" 10.0 (Build 22631)
- locale is en-US

#### Project info

- sdk constraint: '^3.4.1'
- dependencies:
- dev_dependencies: lints, test

#### Process info

| Memory | CPU | Elapsed time | Command line |
| -----: | --: | -----------: | ------------ |
| 133 MB |  -- |              | dart.exe     |
|  95 MB |  -- |              | dart.exe     |

Although it says Windows 10, this is Windows 11, running commands in new Terminal program. Not sure if that makes a difference.

@github-actions github-actions bot removed the needs-info We need additional information from the issue author (auto-closed after 14 days if no response) label Jun 5, 2024
@bkonyi
Copy link
Contributor

bkonyi commented Jun 7, 2024

Thanks for the response @dnys1.

I've tried to run using the Dart SDK shipped with Flutter, but I'm still unable to reproduce:

PS D:\> dart --version
Dart SDK version: 3.5.0-234.0.dev (dev) (Thu Jun 6 17:03:02 2024 -0700) on "windows_x64"
PS D:\> dart run --enable-vm-service=0 .\foo.dart
The Dart VM service is listening on http://127.0.0.1:50415/efUSziJRNGI=/
The Dart DevTools debugger and profiler is available at: http://127.0.0.1:50415/efUSziJRNGI=/devtools?uri=ws://127.0.0.1:50415/efUSziJRNGI=/ws
hello world!

Is there anything special about your drive configuration by any chance? I know we've had some issues with Dev Drives before, although I'm a bit fuzzy on what was actually impacted.

Would it be possible for you to try moving your SDK (or creating a new copy of it) on your D:\ drive and seeing if you can reproduce?

@dnys1
Copy link
Contributor Author

dnys1 commented Jun 8, 2024

Welp.. I went to dive in and debug this but as soon as I started, I was no longer able to consistently reproduce it. Not sure what to make of it!

I'll close this for now and chalk it up to something being wrong with my dev setup.

I appreciate the quick help, @bkonyi!

@dnys1 dnys1 closed this as completed Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-run Issues related to 'dart run' P1 A high priority bug; for example, a single project is unusable or has many test failures triaged Issue has been triaged by sub team
Projects
None yet
Development

No branches or pull requests

4 participants