-
Notifications
You must be signed in to change notification settings - Fork 29.8k
[flutter_tools] support flutter run -d winuwp #79684
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
Conversation
|
For the path:
|
packages/flutter_tools/pubspec.yaml
Outdated
| cli_util: 0.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" | ||
| clock: 1.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" | ||
| csslib: 0.17.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" | ||
| devtools: 2.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" |
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.
yay!
| useSseForDebugProxy: useSseForDebugProxy, | ||
| useSseForDebugBackend: useSseForDebugBackend, | ||
| useSseForInjectedClient: useSseForInjectedClient, | ||
| serveDevTools: false, |
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.
This change was required to roll in dwds, was the fix for the removal of the devtools dep I landed to resolve the version conflict post mortem
|
Is it possible to stage the package updates before this PR so they can be tested separately on CI? |
|
Done here: #81403 |
clarkezone
left a comment
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
| if (!cmakeFile.existsSync()) { | ||
| return null; | ||
| } | ||
| final RegExp nameSetPattern = RegExp(r'^\s*set\(PACKAGE_GUID\s*"(.*)"\s*\)\s*$'); |
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.
Does this regexp have test coverage?
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.
Done
| throw WindowsException(hResult); | ||
| } | ||
| final int id = processId.value; | ||
| free(aumid); |
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.
free() calls should go in a finally {} block, for example to cover the exception thrown on line 30.
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.
Done
| free(processId); | ||
| free(aam.ptr); | ||
| free(arguments); | ||
| CoUninitialize(); |
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.
And I'm guessing this as well would have to go in the finally {} ?
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.
Done
| _nativeApi = nativeApi, | ||
| _operatingSystemUtils = operatingSystemUtils, | ||
| _fileSystem = fileSystem, | ||
| super( |
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 the indentation right here?
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.
Done
| const Win32NativeApi(); | ||
|
|
||
| @override | ||
| int launchApp(String amuid, List<String> args) { |
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.
@clarkezone @cbracken Was an alternative design considered in which we would get this functionality from a utility bundled with the Windows engine artifacts instead of adding the ffi dependencies to the flutter_tool? For example, the Windows engine artifacts could come with a program, like uwp_launcher that does what is in this file, and then the flutter_tool could launch a uwp app using dart:io as usual through that launcher program?
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.
Having an adb like program for UWP would be pretty neat. I have to add that I'm indifferent between that and using ffi, but prefer both to calling out to powershell scripts. The former could give reasonable exit codes with meaning, the latter is just sort of a jumbled mess of text
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.
Even something less ambitious than adb might be easier to maintain and test than introducing dart:ffi to the tool for the first time. I would like to hear thoughts from @clarkezone and @cbracken on this before we land this PR because I suspect if this is landed as-is we won't take the opportunity to consider this again.
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.
I don't have strong opinion either way, although in the short term getting a E2E working solution is a high priority so I would prefer to get to that and improve / refactor later than do a big refactor now.
|
Fixed the issues with the install path @clarkezone , but hit another error. I'm assuming this script requires some additional arguments? |
|
Hmm that's weird.. I'm not needing to provide extra arguments from the cmdline. What happens if you |
|
Oh duh, my b |
|
The actual error is: |
|
Try going to start menu and uninstalling the app manually |
|
The problem is that the Add App package script does not install in dev mode by default, need to call install.ps1 which is in the same folder |
|
Does that fix it? |
|
Seems to work consistently. Unfortunately on ToT the app isn't actually starting for me, I just a blank blue screen |
|
OK, problem was the old that was installed correctly was never getting uninstalled |
Allow flutter run to work end to end with a UWP device. Uses win32/ffi for the actual launch of the application, injected via the native API class. This is structured to avoid a g3 dependency. Install and amuid require powershell scripts for now. Actually connecting to the observatory requires running a command in an elevated prompt. Instructions are presented to the user if a terminal is attached. This is a rebased version of flutter#79684 by @jonahwilliams.
Allow flutter run to work end-to-end with a UWP device. Uses win32/ffi for the actual launch of the application, injected via the native API class. This is structured to avoid a g3 dependency. Install and amuid require powershell scripts for now. Actually connecting to the observatory requires running a command in an elevated prompt. Instructions are presented to the user if a terminal is attached. This is a rebased version of #79684 by @jonahwilliams, updated to remove `NativeApi` and replace is with calls to `uwptool`. Part of #82085
|
Superseded by #82373 |
Allow
flutter runto work end to end with a UWP device.Uses win32/ffi for the actual launch of the application, injected via the native API class. This is structured to avoid a g3 dependency.
Install and amuid require powershell scripts for now.
Actually connecting to the observatory requires running a command in an elevated prompt. Instructions are presented to the user if a terminal is attached.