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

feat: less noisy run-ios build failures with xcpretty #1393

Conversation

liamjones
Copy link
Contributor

Summary:

The run-ios command detects and uses xcpretty (https://github.com/xcpretty/xcpretty) if it's available. If it's not available it displays a loader/spinner animation until xcodebuild finishes.

If a build failure happens then the buildOutput and errorOutput are included in the raised CLIError and printed out to the terminal.

This makes sense when xcpretty isn't present as there has been no build output displayed up to now. However, if xcpretty is being used, this behaviour makes less sense:

Firstly, xcpretty has been doing coloured output, nicely highlighting warnings and errors as they happened. The raised CLIError will repeat the output but without colours which means you have to scroll back up past a potential mountain of monochrome xcodebuild output to find the xcpretty output (or attempt to pick out the error from the monochrome output).

Secondly, you will be prompted to "Run CLI with --verbose flag for more details." upon build failure anyway. If you use xcpretty then running the build again with the --verbose flag would force raw xcodebuild output (which would then including the buildOutput and errorOutput again).

Test Plan:

Tested manually with and without xcpretty installed.

The run-ios command detects and uses xcpretty (https://github.com/xcpretty/xcpretty) if it's available. If it's not available it displays a loader/spinner animation until xcodebuild finishes.

If a build failure happens then the buildOutput and errorOutput are included in the raised CLIError and printed out to the terminal.

This makes sense when xcpretty isn't present as there has been no build output displayed up to now. However, if xcpretty is being used, this behaviour makes less sense:

Firstly, xcpretty has been doing coloured output, nicely highlighting warnings and errors as they happened. The raised CLIError will repeat the output but without colours which means you have to scroll back up past a potential mountain of monochrome xcodebuild output to find the xcpretty output (or attempt to pick out the error from the monochrome output).

Secondly, you will be prompted to "Run CLI with --verbose flag for more details." upon build failure anyway. If you use xcpretty then running the build again with the --verbose flag would force raw xcodebuild output (which would then including the buildOutput and errorOutput again).
@liamjones
Copy link
Contributor Author

One extra point concerning this:

Secondly, you will be prompted to "Run CLI with --verbose flag for more details." upon build failure anyway. If you use xcpretty then running the build again with the --verbose flag would force raw xcodebuild output (which would then including the buildOutput and errorOutput again).

The --verbose flag doesn't seem to function currently - see #1391. If this PR is approved, you may want to hold off merging this until that bug is resolved.

@thymikee
Copy link
Member

thymikee commented Apr 7, 2021

Please send some screenshots/videos of the change :)

@liamjones
Copy link
Contributor Author

@thymikee here you go:

Before changes: https://youtu.be/ZhpZurWsAso

After changes: https://youtu.be/sjNf7eGY8Gs

@grabbou grabbou merged commit 84e91a9 into react-native-community:master Jul 19, 2021
@grabbou
Copy link
Member

grabbou commented Jul 19, 2021

Thank you for sending this over!

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

Successfully merging this pull request may close these issues.

None yet

3 participants