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

pub run should not emit any output not from the executable #2545

Closed
jathak opened this issue Jul 1, 2020 · 3 comments
Closed

pub run should not emit any output not from the executable #2545

jathak opened this issue Jul 1, 2020 · 3 comments
Assignees

Comments

@jathak
Copy link

jathak commented Jul 1, 2020

Environment

  • pub version or flutter pub version: Pub 2.9.0-19.0-dev
  • OS version: CI on Ubuntu, macOS, and Windows, locally on Debian
  • Are you using the Chinese community mirror or a corporate firewall? No

Problem

Our tests are failing when run against the current dev version of the Dart SDK because pub run has started emitting output related to precompilation and we're expecting only output from the executable we're trying to run.

This issue is not present in the current stable SDK.

Expected behavior

pub run <executable> should only emit output from the executable itself.

Actual behavior

pub run <executable> first emits Precompiling executable... and other related lines.

jathak added a commit to google/dart_cli_pkg that referenced this issue Jul 1, 2020
@nex3
Copy link
Member

nex3 commented Jul 21, 2020

This is also breaking our ability to use the protobuf compiler; see https://travis-ci.com/github/sass/dart-sass-embedded/jobs/363118689.

In general, I would expect an executable runner to never add its own output to stdout (or stderr), since those streams may be used by the underlying executable to communicate along a particular protocol.

nex3 added a commit to sass/dart-sass-embedded that referenced this issue Jul 21, 2020
@sigurdm sigurdm self-assigned this Jul 23, 2020
@sigurdm
Copy link
Contributor

sigurdm commented Jul 23, 2020

I believe this is a duplicate of #2525
It was fixed in a8e2442b that should be included in 2.10.0-0.0.dev .

@sigurdm sigurdm closed this as completed Jul 23, 2020
nex3 added a commit to sass/dart-sass-embedded that referenced this issue Aug 12, 2020
nex3 added a commit to sass/dart-sass-embedded that referenced this issue Aug 13, 2020
nex3 added a commit to sass/dart-sass-embedded that referenced this issue Aug 13, 2020
@alextekartik
Copy link

alextekartik commented Oct 2, 2020

Even with "only print if there is a console attached" scenario, if any callers relies on stdout it will break.

In travis for example, My all dart setup (that dart file was writing a .rc file and printing the tmp filename to source) was:

before_script:
  - source $(dart pub run xxxx)

I had to add a warmup calls just to workaround this issue

before_script:
  # Dummy initial call
  - dart pub run xxxx --help
  - source $(dart pub run xxxx)

As I change sdk often, just calling stagehand sometimes displays:

$ stagehand --version
stagehand version: 3.3.9

and sometimes

$ stagehand --version
Can't load Kernel binary: Invalid SDK hash.
Precompiling executable... 
Precompiled stagehand:stagehand.
stagehand version: 3.3.9

Why not printing to stderr instead?

joshpeterson30489 added a commit to joshpeterson30489/embedded-dart-sass-development that referenced this issue Sep 30, 2022
joshpeterson30489 added a commit to joshpeterson30489/embedded-dart-sass-development that referenced this issue Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants