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

"Welcome to Flutter" and "Waiting for lock" messages break --machine commands #54014

Open
pchampio opened this issue Apr 4, 2020 · 5 comments
Labels
P2 Important issues not at the top of the work list team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team

Comments

@pchampio
Copy link

pchampio commented Apr 4, 2020

sudo flutter channel --version --machine is responding with a non json output, this break other toolkit/ci-cd that are relying on this --machine flag go-flutter-desktop/go-flutter#384.

$ sudo flutter channel --version --machine     
Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
{
  "frameworkVersion": "1.16.4-pre.88",
  "channel": "master",
  "repositoryUrl": "https://github.com/flutter/flutter.git",
  "frameworkRevision": "ab14307e0c77e4a03ea23ccaa68436d9128a445d",
  "frameworkCommitDate": "2020-04-03 00:56:01 -0400",
  "engineRevision": "f5127cc07a762de774b7e941fe6eb402c97aa1b3",
  "dartSdkVersion": "2.8.0 (build 2.8.0-dev.19.0 fae35fca47)"
}

  ╔════════════════════════════════════════════════════════════════════════════╗
  ║                 Welcome to Flutter! - https://flutter.dev                  ║
  ║                                                                            ║
  ║ The Flutter tool uses Google Analytics to anonymously report feature usage ║
  ║ statistics and basic crash reports. This data is used to help improve      ║
  ║ Flutter tools over time.                                                   ║
  ║                                                                            ║
  ║ Flutter tool analytics are not sent on the very first run. To disable      ║
  ║ reporting, type 'flutter config --no-analytics'. To display the current    ║
  ║ setting, type 'flutter config'. If you opt out of analytics, an opt-out    ║
  ║ event will be sent, and then no further information will be sent by the    ║
  ║ Flutter tool.                                                              ║
  ║                                                                            ║
  ║ By downloading the Flutter SDK, you agree to the Google Terms of Service.  ║
  ║ Note: The Google Privacy Policy describes how data is handled in this      ║
  ║ service.                                                                   ║
  ║                                                                            ║
  ║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and  ║
  ║ crash reports to Google.                                                   ║
  ║                                                                            ║
  ║ Read about data we send with crash reports:                                ║
  ║ https://flutter.dev/docs/reference/crash-reporting                         ║
  ║                                                                            ║
  ║ See Google's privacy policy:                                               ║
  ║ https://policies.google.com/privacy                                        ║
  ╚════════════════════════════════════════════════════════════════════════════╝
@iapicca iapicca added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 6, 2020
@jmagman jmagman added this to Awaiting triage in Tools - command line usability review via automation Apr 7, 2020
@pchampio
Copy link
Author

$ flutter --version --machine
Waiting for another flutter command to release the startup lock...
{
  "frameworkVersion": "1.17.0",
  "channel": "beta",
  "repositoryUrl": "https://github.com/flutter/flutter.git",
  "frameworkRevision": "d3ed9ec945f8869f0e136c357d0c2a6be2b60c98",
  "frameworkCommitDate": "2020-04-06 14:07:34 -0700",
  "engineRevision": "c9506cb8e93e5e8879152ff5c948b175abb5b997",
  "dartSdkVersion": "2.8.0 (build 2.8.0-dev.18.0 eea9717938)"
}

@GeertJohan
Copy link

The non-JSON output can be written to stderr, so that stdout is still 'clean' for machines to read.

@jonahwilliams jonahwilliams changed the title Tookit flutter --machine returns non json string "Welcome to Flutter" and "Waiting for lock" messages break --machine commands Apr 25, 2020
@jonahwilliams jonahwilliams moved this from Awaiting triage to Engineer reviewed in Tools - command line usability review Apr 25, 2020
@jonahwilliams
Copy link
Member

We've moved some of the diagnostic messages to stderr, though this does not yet include the welcome message. This could be fixed by detecting if a machine flag was passed and eliding it.

@sigurdm
Copy link
Contributor

sigurdm commented Jun 2, 2022

This could be fixed by detecting if a machine flag was passed and eliding it.

Is there any reason to not always output the welcome message on stderr?

@christopherfujino
Copy link
Member

This could be fixed by detecting if a machine flag was passed and eliding it.

Is there any reason to not always output the welcome message on stderr?

I believe there have been concerns (from product) that the default command prompt setup on Windows colors STDERR red, and that too much red would scare new users.

@christopherfujino christopherfujino added the P2 Important issues not at the top of the work list label Mar 7, 2023
@flutter-triage-bot flutter-triage-bot bot added team-tool Owned by Flutter Tool team triaged-tool Triaged by Flutter Tool team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important issues not at the top of the work list team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team
Projects
Development

No branches or pull requests

6 participants