Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

patch: restore output from failed patch #18963

Merged
merged 1 commit into from
Dec 20, 2024
Merged

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Dec 19, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Before #18613, we used safe_system which would print stderr by default. After switching to Utils.safe_popen_write, stderr/stdout is captured in the exception and discarded.

This had caused some confusion in PRs as the resulting logs don't clearly explain failure.

Current brew output looks like:

==> Patching
==> Applying b6cf2e7222c24343b868986e867ddb7adad0bf30.patch

READ THIS: https://docs.brew.sh/Troubleshooting

With change, the output is shown to user, e.g.

==> Patching
==> Applying b6cf2e7222c24343b868986e867ddb7adad0bf30.patch
Error: Failure while executing; `patch -g 0 -f -p1` exited with 1. Here's the output:
patching file 'src/fastnetmon.cpp'
2 out of 2 hunks failed--saving rejects to 'src/fastnetmon.cpp.rej'
patching file 'src/fastnetmon_api_client.cpp'
2 out of 2 hunks failed--saving rejects to 'src/fastnetmon_api_client.cpp.rej'

READ THIS: https://docs.brew.sh/Troubleshooting

@cho-m cho-m force-pushed the patch-show-failed-output branch from 0352c41 to d4e06b4 Compare December 19, 2024 19:56
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 20, 2024
Merged via the queue into master with commit b35ff5d Dec 20, 2024
28 checks passed
@MikeMcQuaid MikeMcQuaid deleted the patch-show-failed-output branch December 20, 2024 08:45
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants