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
[flutter_tools] Add support for vmServiceFileInfo when attaching #128503
[flutter_tools] Add support for vmServiceFileInfo when attaching #128503
Conversation
487e8d5
to
381c6f2
Compare
When building the new SDK DAPs, this functionality was missed from the Flutter adapter (but added to the Dart CLI adapter). As well as passing a VM Service URI directly, we support passing a file that can be polled for it. This uses the same mechanism we use to obtain the VM Service URI from a Dart debug session (we run "dart --write-service-info=foo.json my_file.dart" and then poll that file) and is useful for users that have their own mechanism for launching an app (for example using custom Flutter embedders - see Dart-Code/Dart-Code#3353) to provide a VM Service URI once the app is up and running. Fixes Dart-Code/Dart-Code#4577.
381c6f2
to
e4ef0bc
Compare
3c02364
to
62534fb
Compare
@@ -40,7 +40,10 @@ Arguments specific to `launchRequest` are: | |||
|
|||
Arguments specific to `attachRequest` are: | |||
|
|||
- `String? vmServiceUri` - the VM Service URI to attach to (if not supplied, Flutter will try to discover it from the device) | |||
- `String vmServiceInfoFile` - the file to read the VM Service info from \* | |||
- `String vmServiceUri` - the VM Service URI to attach to \* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this now non-nullable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, no - apparently I pasted the Dart version over this and didn't check it properly (it's wrong there, and I also lost the additional explanatory text). Fixed!
String? vmServiceUri = args.vmServiceUri; | ||
final String? vmServiceInfoFile = args.vmServiceInfoFile; | ||
|
||
if (vmServiceUri != null && vmServiceInfoFile != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if they're both null? Do we try to discover it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I've made the error text a bit clearer (and also reintroduced this explanation in the readme noted above).
Out of interest - does the autosubmit bot handle review status? Like if I add the tag now, would it just blindly merge when the build is green, or wait for you to approve? 🤔 |
Unfortunately, I think it would remove the label since it's not approved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM and added the label for you :) |
Ah, yes. I wonder if it's worth a feature request to just delay until it's reviewed? I think that's what Gerrit does - you can add AutoSubmit to mean "when this is approved, land it without me needing to come back and do it"
Thanks! :) |
Good idea ;) #113638 |
LOL! Always one step ahead 😁 |
When building the new SDK DAPs, this functionality was missed from the Flutter adapter (but added to the Dart CLI adapter).
As well as passing a VM Service URI directly, we support passing a file that can be polled for it.
This uses the same mechanism we use to obtain the VM Service URI from a Dart debug session (we run
dart --write-service-info=foo.json my_file.dart
and then poll that file which the VM will write) and is useful for users that have their own mechanism for launching an app (for example using custom Flutter embedders - see Dart-Code/Dart-Code#3353) to provide a VM Service URI once the app is up and running.Fixes Dart-Code/Dart-Code#4577.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.