Skip to content

fix(oxfmt): Use std(out/err)._handle.setBlocking(true) to handle WouldBlock error in Rust#17950

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-13-fix_oxfmt_use_stdout_err_setblocking_true_to_handle_wouldblock_error
Jan 13, 2026
Merged

fix(oxfmt): Use std(out/err)._handle.setBlocking(true) to handle WouldBlock error in Rust#17950
graphite-app[bot] merged 1 commit intomainfrom
01-13-fix_oxfmt_use_stdout_err_setblocking_true_to_handle_wouldblock_error

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Jan 13, 2026

Fixes #17939, closes #17943 and #17946.

Copilot AI review requested due to automatic review settings January 13, 2026 04:44
@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter C-bug Category - Bug labels Jan 13, 2026
Copy link
Member Author

leaysgur commented Jan 13, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@leaysgur leaysgur changed the title fix(oxfmt): Use stdout/err setBlocking(true) to handle WouldBlock error fix(oxfmt): Use std(out/err)._handle.setBlocking(true) to handle WouldBlock error in Rust Jan 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a WouldBlock error that occurs when writing large output in Rust through NAPI bindings. The issue arises because Node.js sets stdio to non-blocking mode by default, which conflicts with Rust's blocking I/O operations when using --stdin-filepath.

Changes:

  • Added code to set stdout and stderr to blocking mode before calling Rust NAPI bindings
  • Added comprehensive comments explaining the fix and why it differs from the yargs/set-blocking approach

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@leaysgur leaysgur force-pushed the 01-13-fix_oxfmt_use_stdout_err_setblocking_true_to_handle_wouldblock_error branch from dff70f4 to 82bc59a Compare January 13, 2026 05:14
@leaysgur leaysgur requested a review from Dunqing January 13, 2026 05:15
@leaysgur leaysgur force-pushed the 01-13-fix_oxfmt_use_stdout_err_setblocking_true_to_handle_wouldblock_error branch from 82bc59a to 6dad761 Compare January 13, 2026 05:17
@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Jan 13, 2026
Copy link
Member

Dunqing commented Jan 13, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the 01-13-fix_oxfmt_use_stdout_err_setblocking_true_to_handle_wouldblock_error branch from 6dad761 to 9d96cc6 Compare January 13, 2026 05:40
@graphite-app graphite-app bot merged commit 9d96cc6 into main Jan 13, 2026
18 checks passed
@graphite-app graphite-app bot deleted the 01-13-fix_oxfmt_use_stdout_err_setblocking_true_to_handle_wouldblock_error branch January 13, 2026 05:46
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 13, 2026
graphite-app bot pushed a commit that referenced this pull request Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-formatter Area - Formatter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oxfmt: Large files truncated when using --stdin-filepath option

3 participants