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

Notify about existing caches when preloading #122592

Merged
merged 8 commits into from Mar 30, 2023

Conversation

sigurdm
Copy link
Contributor

@sigurdm sigurdm commented Mar 14, 2023

Check if there are existing user caches when Flutter is first time accessing the pub cache after extracting the downloaded archive.

If they exist we give instructions how to reset/repair these caches.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Mar 14, 2023
@sigurdm sigurdm requested a review from jonasfj March 14, 2023 10:18
@sigurdm
Copy link
Contributor Author

sigurdm commented Mar 14, 2023

See internal doc: go/dart-flutter-pub-alignment for design/details

Copy link
Member

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I wonder if this will break flutter run --machine. This is what I get when I run flutter run -d linux --machine 2>/dev/null

$ flutter run -d linux --machine 2>/dev/null
Found an existing Pub cache at /home/fujino/.pub-cache.
It can be repaired by running `dart pub cache repair`.
It can be reset by running `dart pub cache clear`.
Found an existing Dart Analysis Server cache at /home/fujino/.dartServer.
It can be reset by deleting /home/fujino/.dartServer.
Resolving dependencies...
  async 2.10.0 (2.11.0 available)
  material_color_utilities 0.2.0 (0.3.0 available)
Got dependencies!
[{"event":"daemon.connected","params":{"version":"0.6.1","pid":834968}}]
[{"event":"app.start","params":{"appId":"2eb0dd8d-adc6-472c-8677-445e19fe35a6","deviceId":"linux","directory":"/home/fujino/git/tmp/delete_me_flutter_box","supportsRestart":true,"launchMode":"run"}}]
Launching lib/main.dart on Linux in debug mode...
[{"event":"app.progress","params":{"appId":"2eb0dd8d-adc6-472c-8677-445e19fe35a6","id":"0","progressId":null,"message":"Building Linux application...","finished":false}}]
[{"event":"app.progress","params":{"appId":"2eb0dd8d-adc6-472c-8677-445e19fe35a6","id":"0","progressId":null,"finished":true}}]
[{"event":"app.stop","params":{"appId":"2eb0dd8d-adc6-472c-8677-445e19fe35a6"}}]

@DanTup is this going to break you?

@DanTup
Copy link
Contributor

DanTup commented Mar 15, 2023

@DanTup is this going to break you?

Assuming what we're talking about here is just extra (non-JSON) stdout content, I don't think so. flutter run --machine already prints a fair bit of non-JSON output (like "Launching lib/main.dart on Linux in debug mode...") so consumers of it already have to handle it (generally anything that doesn't parse as a JSON list just goes straight to the Debug Console).

It's not great that it works this way - if a user prints well-formed JSON from their flutter app, we will try to interpret it as an event from the Flutter daemon. It would be better if all output was wrapped in the JSON protocol, but I think some of it ("Building flutter tool") can come from the shell script so it may be more trouble than it's worth.

@christopherfujino
Copy link
Member

@DanTup is this going to break you?

Assuming what we're talking about here is just extra (non-JSON) stdout content, I don't think so. flutter run --machine already prints a fair bit of non-JSON output (like "Launching lib/main.dart on Linux in debug mode...") so consumers of it already have to handle it (generally anything that doesn't parse as a JSON list just goes straight to the Debug Console).

It's not great that it works this way - if a user prints well-formed JSON from their flutter app, we will try to interpret it as an event from the Flutter daemon. It would be better if all output was wrapped in the JSON protocol, but I think some of it ("Building flutter tool") can come from the shell script so it may be more trouble than it's worth.

Ahh, good to know how this works. I'll file a tracking issue for this, but you're right, we'll probably never be 100% JSON, because I'm not interested in parsing all CLI flags from bash :P

Copy link
Member

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sigurdm sigurdm closed this Mar 17, 2023
@sigurdm sigurdm reopened this Mar 17, 2023
@sigurdm sigurdm merged commit 7b54a30 into flutter:master Mar 30, 2023
123 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
exaby73 pushed a commit to NevercodeHQ/flutter that referenced this pull request Apr 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants