Extract tarballs with a UTF-8 locale #24304

Merged
IngmarStein opened 9:55am on October 20, 2026 wanted to merge 20 ฮ” into homebrew/brew main from
tar-utf8-locale

Pull Request Overview

  • Opened on October 20, 2026
  • Status Merged
  • Commit count 1 with first commit October 19, 2026

Total Delta

20 Total Diff Delta

Open Days

Open 16 weekdays

Test Delta

0 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Fraction of total time Business days Phase
 
0.0 days Authoring 1 commit before pull request opened for review
 
0.0 days Awaiting first review
Set up deploy tracking to begin tracking full PR start-to-deploy times

Total time for pull request 0.0 business days from first commit authored to merge
Deploy tracking has not been set up

Author avatar

Extract tarballs with a UTF-8 locale



  • LC_ALL=C makes tar fail on archives containing non-ASCII paths because bsdtar cannot convert those paths to an ASCII character set. This broke with https://github.com/Homebrew/brew/pull/24278.


  • en_US.UTF-8 keeps diagnostics in English for the out-of-space handling in unpack_strategy.rb while allowing UTF-8 paths



  • [x] Have you followed our Contributing guidelines?

  • [x] Have you checked for other open Pull Requests for the same change?

  • [x] Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.

  • [x] Have you explained why you'd like these changes included, not just what they do?

  • [ ] For bug fixes, have you given step-by-step brew commands to reproduce the bug?

  • [x] Have you written new tests (excluding integration tests)? Here's an example.

  • [x] Have you successfully run brew lgtm (style, typechecking and tests) locally?



  • [x] I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Github Copilot diagnosed the issue in an Actuion Run and Claude Opus 5.5 was used to validate and look at formula-side workarounds. The diff itself is trivial.


Summary by CodeRabbit



  • Bug Fixes


    • Improved TAR archive extraction for paths containing non-ASCII characters.

    • Preserved English-language extraction diagnostics while using UTF-8 locale support.



Comments Threads Pending Resolution

MikeMcQuaid reviewed and approved this work on October 20, 2026
MikeMcQuaid left a comment

Thanks, let's try it. If this still causes errors we'll revert https://github.com/Homebrew/brew/pull/24278

coderabbitai[bot] reviewed on October 20, 2026
coderabbitai[bot] left a comment

**Actionable comments posted: 1**

๐Ÿงน Nitpick comments: 1

Library/Homebrew/test/unpack_strategy/tar_spec.rb: 1

`65-66`: **๐Ÿ“ Maintainability & Code Quality** | **๐Ÿ”ต Trivial** | **โšก Quick win**

**Add an end-to-end regression case for a non-ASCII path.**

This example stubs `system_command!`, so it verifies only the `LC_ALL` argument. It does not prove that `bsdtar` extracts a non-ASCII path with this locale. Add a fixture or temporary archive containing a non-ASCII entry and assert the extracted path.

---

โ„น๏ธ Review info

โš™๏ธ Run configuration

- **Configuration used**: Organization UI
- **Review profile**: CHILL
- **Plan**: Advanced
- **Run ID**: `b623c28d-d633-4264-b4a7-484a22dabc5e`

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 41f40decfa0789cff312806606757300bb8bd1c3 and b0eb4e4e8340cddffb3432fc36be9388e2529920.

๐Ÿ“’ Files selected for processing: 2

* `Library/Homebrew/test/unpack_strategy/tar_spec.rb`
* `Library/Homebrew/unpack_strategy/tar.rb`

**Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Library/Homebrew/unpack_strategy/tar.rb
54
                                  "--directory", unpack_dir],
55 55
                        # Keep tar diagnostics in English so that 
`unpack_strategy.rb`
 
can
56
                        # recognize out-of-space errors, while using a UTF-8 character set so
57
                        # that archives containing non-ASCII paths can be extracted.
57 58
                        env:     { "LC_ALL" => "
en_US.UTF-8
" },

Resolved Comment Threads

No resolved comments have been left on this PR.