Skip to content

[dartdev] dart run progress updates on stdout that's not the Dart program #61696

@dcharkes

Description

@dcharkes

In Dart, I believe we follow the Google shell guide which says you should only add things to stderr which are actual errors. This means that logs and progress updates go to stdout. We rely on this when we do process calls where we usually forward stderr from the child process to the terminal to surface errors (for example stderr from build hooks).

In Unix philosophy, stdout should only contain the final result, so that it can be piped. This means that logs and progress updates go to stderr. We don't follow this in dart run and dart test, they print progress messages from pub and compilation.

If we want to satisfy both guides, it basically means no output at all while compiling for dart run, which can lead to "did the program freeze"?

For other commands such as dart compile, dart build, and dart install it's not an issue, because the output is the compilation. dart installed apps don't have they issue either (but dart pub global activated suffer from recompilation delay).

For dart run and dart test, should we consider switching to the Unix philosophy? Or is the intended way to do this dart--verbosity=error run? We currently don't respect that for progress updates either, we print things from pub and compiling the app.

@mit-mit @bkonyi

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions