Skip to content

Fix some stdout issues with concurrence #20283

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

Merged
merged 2 commits into from
Jul 21, 2025

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Jul 20, 2025

If HOMEBREW_DOWNLOAD_CONCURRENCY is set, every brew command calls Tty::hide_cursor and Tty::show_cursor, which prints invisible characters to stdout. This breaks things like brew info --json=v2 wget | jq . and also some of brew tests.

This PR modifies the DownloadQueue#fetch method to return early if there are no pending downloads, and to handle a single download as if HOMEBREW_DOWNLOAD_CONCURRENCY is set to 1. This means that we only enter the region that needs to hide and show the cursor if we actually need.

To avoid this regressing in the future, we should really have at least one integration test that has concurrency enabled, but I held off on that for now since we may get that for free if concurrent downloads ever become the default

@Rylan12 Rylan12 requested a review from MikeMcQuaid July 20, 2025 21:19
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.

Good catch, thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jul 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 21, 2025
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jul 21, 2025
Merged via the queue into main with commit 0f92fd7 Jul 21, 2025
36 checks passed
@MikeMcQuaid MikeMcQuaid deleted the skip-concurrent-fetch-fix-tests branch July 21, 2025 07:53
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.

3 participants