Repository navigation
Preserve build errors with Pathname arguments - #24292
Merged
Merged
Conversation
There was a problem hiding this comment.
🧹 Nitpick comments: 1
Library/Homebrew/test/utils/fork_spec.rb: 1
31-42: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the reconstructed
BuildErrorfields directly.
Exception#==does not compareBuildError#cmd,BuildError#args, orBuildError#env. The current fixture convertsPathname,Integer, andSymbolvalues to strings during serialisation, but the generated message remains equal. The test can therefore pass while the reconstructed fields are altered.✅ Suggested fix to assert the reconstructed values
- error = BuildError.new(nil, Pathname("/bin/false"), ["arg1", 2, Pathname("arg 3"), :arg4], {}) + error = BuildError.new(nil, Pathname("/bin/false"), ["arg1", 2, Pathname("arg 3"), :arg4], { "PATH" => "/bin" }) error.set_backtrace ["/some/file.rb:1:in 'block'"] IO.pipe do |reader, writer| described_class.report_forked_child_error(writer, error) - expect(described_class.rewrite_child_error(JSON.parse(reader.read))).to eq(error) + rewritten = described_class.rewrite_child_error(JSON.parse(reader.read)) + expect(rewritten).to eq(error) + expect(rewritten).to have_attributes( + cmd: "/bin/false", + args: ["arg1", "2", "arg 3", "arg4"], + env: { "PATH" => "/bin" }, + ) end
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2ed1b977-9478-4b2d-acc8-2ef19f86a0d8
📒 Files selected for processing: 2
Library/Homebrew/test/utils/fork_spec.rbLibrary/Homebrew/utils/fork.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.
- Stringify `BuildError` commands and arguments so JSON reporting preserves the original failure when formulae pass `Pathname`s. - Assert reconstructed fields so error equality cannot hide data loss. Fixes #24291
MikeMcQuaid
force-pushed
the
pathname-build-error-json
branch
from
October 17, 2026 19:16
997c536 to
b859f85
Compare
MikeMcQuaid
enabled auto-merge
October 17, 2026 19:16
carlocab
approved these changes
Oct 18, 2026
dduugg
approved these changes
Oct 18, 2026
7 of 8 tasks
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-Homebrew__brew
that referenced
this pull request
Oct 18, 2026
- Homebrew#24292 stringified `BuildError` fields but `ErrorDuringExecution` commands can also hold `Pathname`s, which still raised `JSON::GeneratorError` and hid the real child error. - Convert `Pathname`s in the `JSON::Coder` block so every error type and field is covered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BuildErrorcommands and arguments so JSON reporting preserves the original failure when formulae passPathnames.Fixes #24291
brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Codex with GPT 6 Astra at Extra High effort, with local review and testing.
Summary by CodeRabbit