Repository navigation
Serialise Pathnames in forked child errors - #24294
Merged
Merged
Conversation
- #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.
Pathnames to strings in theJSON::Coderblock inUtils.report_forked_child_error.Follow-up to #24292, which fixed the
BuildErrorpath of #24291.ErrorDuringExecution#cmdcan also containPathnames (e.g. fromUtils.safe_popen_readorsystem_command!with aPathnameexecutable), and those still raisedJSON::GeneratorError: Pathname not allowed in JSON, hiding the real child error. HandlingPathnamein the coder covers every error type and field in one place.The new spec in
test/utils/fork_spec.rbreproduces the failure: it raisesJSON::GeneratorErrorwithout theutils/fork.rbchange and passes with it.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Code (Claude Opus 5.5) reviewed #24292, found the remaining
ErrorDuringExecutioncase by round-tripping errors throughreport_forked_child_errorandrewrite_child_error, then wrote the spec (red/green verified) and the one-line fix. I reviewed the diff and ranbrew lgtm --onlinelocally.Summary by CodeRabbit
Pathnamecommands as strings while retaining the original error class.