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

When capturing_stdout also print the stdout in case of error #31

Open
joecks opened this issue Jul 4, 2022 · 2 comments
Open

When capturing_stdout also print the stdout in case of error #31

joecks opened this issue Jul 4, 2022 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@joecks
Copy link

joecks commented Jul 4, 2022

When capturing_stdout:true is set and the flutter command fails, we also need to know what the stdout contained in order to understand the context of the issue.

          unless wait_thread.value.success? || (ignore_error == true)
            UI.shell_error!(<<-ERROR)
The following command has failed:
$ #{command}
[#{wait_thread.value}]

#{errors_thread.value}

Command output:
#[output]
ERROR
          end

          ignore_error
        end

I could also imagine to configure this with a parameter.
This behaviour is a bit annoying when running command on the CI, and errors can not be reproduced locally.

@dotdoom
Copy link
Owner

dotdoom commented Jul 4, 2022

Agree. The general expectation is that the call site would play nicely as well and spit the output when necessary (that's what... Capturing means). I can understand the overhead in writing that code, but I also found stdout too noisy most of the time and containing a lot of redherring distracting from actual troubleshooting. Especially the build command. Do you happen to have an example of what command would fail and conceal context in stdout, so that I can play with verbosity a bit to find a way to guess the intent?

Providing an argument sounds good anyway.

@dotdoom dotdoom added enhancement New feature or request good first issue Good for newcomers labels Jul 4, 2022
@joecks
Copy link
Author

joecks commented Jul 5, 2022

From our project:
https://github.com/xaynetwork/xayn_discovery_app/runs/7152843111?check_suite_focus=true#step:8:532

it basically only prints that we had an error:

The following command has failed:
$ /Users/runner/hostedtoolcache/flutter/bin/flutter build ios --release --build-number\=1419 --build-name\=3.41.0-31-gbb01e5a5 --dart-define\=GIT_TAG\=3.41.0-31-gbb01e5a5 --dart-define\=USER_APP_ID\=com.xayn.discovery.internal --dart-define\=USER_APP_NAME\=Xayn\ News\[i\] --dart-define\=USER_FLAVOR\=internal --dart-define\=USER_PROVISIONING_PROFILE\=Xayn\ Discovery\ Internal\ Adhoc\ Profile --dart-define\=USER_CERTIFICATE\=Apple\ Distribution:\ Xayn\ AG\ \(586TQ875ST\) --no-codesign --bundle-sksl-path flutter_01.sksl.json
[pid 32725 exit 1]
Encountered error while building for device.

And stdout reported a warning that the SKSL kernel file doesn't match the Flutter version.
It was basically the last print statement before it failed.
Generally in my experience, all flutter commands might report a warning or an error to STDOUT instead of STDERR and just fail with a short message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants