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

Show more detailed Flutter build progress #4938

Closed
Number-3434 opened this issue Jan 14, 2024 · 9 comments · Fixed by flutter/flutter#142524
Closed

Show more detailed Flutter build progress #4938

Number-3434 opened this issue Jan 14, 2024 · 9 comments · Fixed by flutter/flutter#142524
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is enhancement relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Milestone

Comments

@Number-3434
Copy link

Number-3434 commented Jan 14, 2024

The Issue

Currently, you are only told when an application has finished building.


Describe the solution you'd like

It would be much more useful to see the current build progress (like in Xcode).

IMG_4598


Additional context

Ideally, this should also show the build phase, and the current completion (e.g. Building: 73% - 27 / 37)

@DanTup
Copy link
Member

DanTup commented Jan 15, 2024

Not currently on Mac, but it seems like we might have a bug here with some progress not showing up. If I run

flutter run --machine -d windows

In the output I see some output like:

[{"event":"app.progress","params":{"appId":"a559c391-9f0b-4e8a-9bf4-fe6e70cd85ca","id":"0","progressId":null,"message":"Building Windows application...","finished":false}}]
[{"event":"app.progress","params":{"appId":"a559c391-9f0b-4e8a-9bf4-fe6e70cd85ca","id":"0","progressId":null,"finished":true}}]

I suspect the same might be true on Mac. However, this output does not seem to show up in either the notification toast or the Debug Console. First job is fixing that. If it's still not enough progress, we might need changes in Flutter to report more detailed progress.

@DanTup DanTup added in flutter Relates to running Flutter apps in debugger Relates to the debug adapter or process of launching a debug session labels Jan 15, 2024
@DanTup DanTup added this to the v3.82.0 milestone Jan 15, 2024
@DanTup DanTup changed the title Show Xcode Build Progress Show more detailed Flutter build progress Jan 15, 2024
@Number-3434
Copy link
Author

Number-3434 commented Jan 15, 2024

Where would this show up?

Would it be in the Debug Console (preferably), or only in the terminal?

@DanTup
Copy link
Member

DanTup commented Jan 15, 2024

When this issue is fixed, the output should be visible in the Debug Console (and possibly the toast notification during builds).

I was using the terminal with the --machine flag to see what output the flutter tool is producing (since the IDE support is essentially using flutter run --machine). It turns out Flutter is producing more output than we are showing in VS Code (in the Debug Console/toasts) so we should wire this up better so it's visible.

@Number-3434
Copy link
Author

Would this work if you used the Run and Debug button in VSCode instead of the command-line?
I'm using Run and Debug, and use the Debug Console instead of the Terminal.

@DanTup
Copy link
Member

DanTup commented Jan 15, 2024

Yes, that's exactly the case that needs fixing :)

I was only using the terminal as a way for testing the output - the bug here (and the fix) is unrelated to the terminal. The debugger (when you click Run or Debug) internally runs flutter run --machine so it's a good way to verify what output we should be getting. In this case, there are some app.progress events that are not being handled (they should be parsed by the debugger and then written to the Debug Console).

@Number-3434
Copy link
Author

Yes, that's exactly the case that needs fixing :)

Got it, thanks for the clarification ;)

DanTup added a commit to DanTup/flutter that referenced this issue Jan 30, 2024
Builds can be slow and the legacy debug adapter would handle Flutter's `app.progress` events to update the toast notification during builds. This was lost in the new adapters - we should only a single "Launching.." notification for the whole progress.

This change listens to `app.progress` events and forwards those with `finished=false` to the client if the launch progress is still active.

Fixes Dart-Code/Dart-Code#4938
@DanTup
Copy link
Member

DanTup commented Jan 30, 2024

Turns out we weren't forwarding these events from the debug adapter to the client so the fix is actually in Flutter. I've opened flutter/flutter#142524 and once merged the fix will ship in a future Flutter SDK release.

@DanTup DanTup modified the milestones: v3.82.0, Requires SDK Release Jan 30, 2024
@Number-3434
Copy link
Author

Turns out we weren't forwarding these events from the debug adapter to the client so the fix is actually in Flutter. I've opened flutter/flutter#142524 and once merged the fix will ship in a future Flutter SDK release.

Okay, thanks

@Number-3434
Copy link
Author

Number-3434 commented Feb 17, 2024

Yay 😃 !

@DanTup DanTup modified the milestones: Requires SDK Release, v3.86.0 Feb 22, 2024
@DanTup DanTup added the relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is enhancement relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants